Starting an e-mail client from a link.

liunx

Guest
Hi Everyone, <br />
<br />
I am not sure if this is an HTML or scripting language question, however here goes, how can I place a link on my web page that when clicked opens the users e-mail program so that they can write a message and send it as normal? I have seen this technology on other sites and when I click their link my Outlook Express program starts so that I can write an e-mail message. <br />
<br />
Any help will be super. <br />
<br />
Thanks<!--content-->Very simple. It's a hyperlink with "mailto" in it.<br />
Here's an example:<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"mailto:[email protected]">email me!</a><br />
<br />
<br />
When a person clicks a mailto link, it launches their default mail program.<br />
<br />
To make the link automatically fill in the Subject field, it's like this:<br />
<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"mailto:[email protected]?subject=blahblahblah">email me!</a><!--content-->simple:<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"mailto: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->">mail me!</a><br />
<br />
<br />
less simple, but cooler in the end:<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br />
<br />
<html><br />
<head><br />
<title>Untitled</title><br />
<script language=javascript><br />
function sendIt(to,cc, bcc, subject, body){<br />
document.email.action="mailto:"+to+"?cc="+cc+"&bcc="+bcc+"&subject="+subject+"&body="+body ;<br />
document.email.submit();<br />
}<br />
</script><br />
</head><br />
<br />
<body><br />
<form name=email><br />
<input type=text name=to>To<br><br />
<input type=text name=cc>CC<br><br />
<input type=text name=bcc>BCC<br><br />
<input type=text name=subject>Subject<br><br />
<textarea cols=32 rows=16 name=body></textarea>Subject<br><br />
<input type=button value=Send onClick="sendIt(email.to.value, email.cc.value, email.bcc.value, email.subject.value, email.body.value)"><br />
&nbsp;&nbsp;&nbsp;<input type=button value=Clear onClick="document.email.reset()"><br />
</form><br />
</body><br />
</html><!--content-->Thanks for all of your help, I have successfully set up my web site for emailing now.<!--content-->
 
Back
Top