views:

125

answers:

3

in my website i want to give a link through which user can send mail to me.

+4  A: 

Simple MailTo

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

MailTo with Multiple Recipients

<a href="mailto:[email protected],[email protected]">mail me</a>

MailTo with Subject

<a href="mailto:[email protected]?subject=Comments from MailTo Syntax Page">mail me</a>

MailTo with a Copy

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

MailTo with a Blind Copy

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

MailTo with message already started in Body

<a href="mailto:[email protected]?body=I am having trouble finding information on ">mail me</a>

MailTo with multiline message in Body

<a href="mailto:[email protected]?body=The message's first paragraph.%0A%0aSecond paragraph.%0A%0AThird Paragraph.">mail me</a>
NOTE: Use "%0A" for a new line, use "%0A%0A" for a new line preceded by a blank line.

Features may be used in combination

MailTo with Subject, a Recipient, a Copy and a Blind Copy

<a href="mailto:[email protected]?subject=MailTo Comments&[email protected]&[email protected]">mail me</a>

It is recommended that you use a process other than MailTo handle the e-mail process from your web site.

If you do use MailTo, please encode the included e-mail address(s) to reduce the spam for that address.

Source

rahul
problem with using mailto: is that you get spammed silly by bots that traul for mail links. I'd rather seen an enquiry form written and sent with .Net.Mail.SmtpClient like DevStuff has suggested. A Captcha is a must too
MJJames
+4  A: 
<a href="mailto:[email protected]">Mail me</a>

When the user clicks the link that this will make on your website, their default email program will open, with your e-mail address in the "to" field.

This has nothing to do with ASP.net 2.0 - it will work on any web page in any web browser, no matter how that web page is generated.

Steve McLeod
+3  A: 

If you don't want to expose an email address to spammers I'd recommend creating a contact form (with a CAPTCHA) and use the System.Net.Mail.MailMessage and System.Net.Mail.SmtpClient classes.

devstuff