1
votes

I'm trying to insert a link into the body of an email:

string.Format("mailto:[email protected]?subject{0}&body{1}", "Subject Message", "Http://hostname/default.aspx?id={0000000-00000-0000-00000000000)&language=en");

My issue is that the link stops before { and the complete link is not clickable.

I have tried to replace { by %7B and } by %7D but it's not working. Do you have any idea on how to implement that kind of URL ?

Thank you

1
Is the BodyFormat Html? msdn.microsoft.com/en-us/library/…Ta01
I have tried with Request.Url.AbsoluteURI. The complete URL is correctly defined in the source code (confirmed with View source) but when I m clicking on the link, the URL is not correctly shown on the Outlook Message body.fix105
I'm using mailto, to open my client email. I don't want to send directly the email. How can we define the mail format with <a href="mailto:[email protected] ....." ?fix105
So you're not programatically generating the email? You have a hyperlink when clicked is opening whatever email client the user has?Ta01
In your example closing GUID bracket is not curly. Is this a typo?Artemix

1 Answers

0
votes

Try using the following as your body (i.e. replacing special characters with hex codes - see http://www.ascii-code.com/ for reference)

Http://hostname/default.aspx%3Fid=%7B0000000-00000-0000-00000000000%7D%26language=en

You mentioned you'd tried this with the brackets - but did you also do the ampersand and question mark?

ps. you're also missing the equals signs from your code. Full code should be:

string.Format("mailto:[email protected]?subject={0}&body={1}", "Subject Message", "Http://hostname/default.aspx%3Fid=%7B0000000-00000-0000-00000000000%7D%26language=en");

Sample stand alone HTML:

<html>
    <body>
        <a href="mailto:[email protected]?subject=test&body=http://hostname/default.aspx%3Fid=%7B0000000-00000-0000-00000000000%7D%26language=en">test</a>
    </body>
</html>