tags:

views:

53

answers:

2

Hi all , 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.

+1  A: 

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.

Steven Robbins
A: 

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.

ullmark
forcing a mailclient to start in pageload etc, would also be a securityrisk and i sure don't want MY browser to be able to do that.
ullmark
Thanks Markus,but even when I am directly using mailto,I am unable to send HTMl elemnts? what i want to know is it possible to send <a> in mail clients through mailto.w8ing for ur reply.
Wondering
We need to sort out if you want to send an email or want the visitor on your site to send an email. If you want to send an email have a look at the "MailMessage" class.If you want to popp up the "compose" window of the visitors default mailclient you cannot control which format they use.
ullmark