简体   繁体   English

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

[英]Using Mailto link can I add the current page in the outlook mail body if possible then how ? in asp.net

using mailto hyperlink I want to add the Current page in the outlook mail body ,using JavaScript or asp.net . 使用mailto超链接我想使用JavaScript或asp.net在Outlook邮件正文中添加当前页面。

Please give ideas so I can try that in our program . 请提供想法,以便我可以在我们的程序中尝试。

Thanks for the help ... 谢谢您的帮助 ...

here is the full code : 这是完整的代码:

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

Send Mail 发送邮件

values are appended just like you do in querystring. 值的添加就像在querystring中一样。 Hope this helps. 希望这可以帮助。

Edit: If you want current page url in body then replace I will go in to body with your current page url. 编辑:如果要在正文中使用当前页面URL,则替换为我将使用当前页面URL进入正文。 It can be done on server (C#) or on client using javascript. 可以在服务器(C#)或使用javascript的客户端上完成。

You can use jQuery for that 您可以为此使用jQuery

Here .email is the class on the link on which you are calling mailto attribute .email是您在其中调用mailto属性的链接上的类

It should look like this 它应该看起来像这样

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

And ContentId is the id of any control whose text you want to append in the body. ContentId是要在正文中附加其文本的任何控件的ID。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM