使用Mailto链接,如果可能的话,我可以在Outlook邮件正文中添加当前页面吗?在 asp.net



使用mailto超链接我想在Outlook邮件正文中添加当前页面,使用JavaScript或 asp.net。

请提供想法,以便我可以在我们的程序中尝试。

感谢您的帮助...

这是完整的代码:

  <a href="mailto:someone@example.com?Subject=this is subject&body=I will go in to body" target="_top">

发送邮件

附加值就像在查询字符串中一样。希望这有帮助。

编辑:如果您希望正文中的当前页面网址,请将我将用您当前的页面网址替换到正文。它可以在服务器(C#)或使用javascript在客户端上完成。

你可以使用 jQuery 来实现这一点

这里.email是你调用 mailto 属性的链接上的类

它应该看起来像这样

<a href="javascript:void(0);" class="email">Mail Here</a>

ContentId 是要将其文本追加到正文中的任何控件的 id。

$(document).ready(function(){
    var body=$("#ContentId").text();
    $(".email").attr("href", "mailto:?subject=...;body"+body+window.location);
});

最新更新