如何在Mailto正文中设置当前页面链接/数据? [英] How Can I Set Current Page Link / Data In Mailto Body?
本文介绍了如何在Mailto正文中设置当前页面链接/数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我在使用mailto:在我的c#应用程序(ASPX)中,现在我需要在用户点击锚点链接时打开Outlook,邮件正文将是当前页面url / data。
但我不想使用javascript。
i到目前为止这样做了:
Hello,
I am using mailto: in my c# application(ASPX) , now i need to open outlook when user clicks in the anchor link, and the body of the mail will be the currentpage url / data.
But I dont want to use javascript.
i did this as far:
<a href=\" mailto:test.test@mail.com?subject=This%20is%20My%20Subject&body=%20This%20is%20body%20area\">
推荐答案
您好,
首先在您的aspx页面中,
Hello,
First in your aspx page,
<a href="#" runat="server" id="ankMailTo">Mail To</a>
然后在你的页面加载事件中写下代码,
then write below code in your page load event,
string link = HttpContext.Current.Request.Url.AbsoluteUri;
ankMailTo.HRef = "mailto:test.test@mail.com?subject=Subject&body=" + link;
这篇关于如何在Mailto正文中设置当前页面链接/数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文