开发者

Using C# or jQuery to cause Outlook window to open with a templated body...

开发者 https://www.devze.com 2023-03-23 20:55 出处:网络
Is it possible, and if so how, to use C# or jQuery in an MVC web application to have a button or a link on a page cause Outlook to open up with a set body and subject?

Is it possible, and if so how, to use C# or jQuery in an MVC web application to have a button or a link on a page cause Outlook to open up with a set body and subject?

Basically, I want the user to be able to choose a template from a dropdownlist and then click a button or link saying 'Sen开发者_C百科d Templated Email' and have the button/link open up the client's Outlook or default email application with the subject and body populated by the template that they chose.

How could I do that?


You can do this:

<a href="mailto:email@emu.edu?subject=Subject&body=Body Text">

...

// something like this
$('#btn').click(function () {
    $('#link').attr('href', 'mailto:' + $('#email').text() + '?body=' + template[idx].body + '&subject=' + template[idx].subject); 
})
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号