Wondering
Wondering

Reputation: 5076

Sending HTML elements through Mails

I want to open a mail client on click of a link. I am using this code:

System.Diagnostics.Process.Start("mailto:email address?subject=[subject text]&body=http://google.com'>here");

its opening the mail client but I am unable to get the link(here).It should come as a link. Is there any way to do it through IsBodyHtml=true? Can anyone help? Thanks.

Upvotes: 1

Views: 102

Answers (2)

ullmark
ullmark

Reputation: 2479

If you want to open the users default mailclient just use a mailto link

<a href="mailto:[email protected]">text</a>

I don't really understand where and when you are running the "Proccess.Start" code but if you want to open a mailclient though the browser a "mailto"-link is the way to go.

You can set subject for the email that opens but that's about it (depending on default mailclient). Doing more like sending etc. would be a securityrisk.

If you need to do more complex things create a form instead for the user to fill in.

Upvotes: 0

Steven Robbins
Steven Robbins

Reputation: 26599

All you are doing there is creating a mailto: link which is just passed to the default email client to process. Although most email clients support address, subject and body I don't think there's any way to force a particular body format, it's entirely up to the client application what it does with that content.

Would changing it to "please visit http://google.com" not suffice? Most email clients will automatically hyperlink anything that looks like a link when you read the email.

Upvotes: 1

Related Questions