Click here to Skip to main content
15,922,584 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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\">
Posted
Updated 26-Jan-15 22:39pm
v3

1 solution

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;
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900