Automatic email link

How do you get a link on your page which will automatically open an email with certain data already in the Subject and body?

I know the:

<a href="">Send me an email</a>

tag works to open their email application, correctly addressed, but how can I specify something as the Subject and the Body?
Who is Participating?
figueiraConnect With a Mentor Commented:
You can use the following javascript function to do the job:

 <title>Open mail window test</title>
<script language="JavaScript">
function openMailWindow(dest, subject, body) {
  var URL = "mailto:" + dest + "?Subject=" + subject;
  URL = URL + "&Body=" + body;
// -->
<a href="javascript:openMailWindow('',
    'A test subject',
    'The e-mail body\nwith more than\na single line');"
    >Open mail window</a>

That worked fine with NS 4.08 and IE 4.0.
Try this:: this would definitely solve your problem::

<title>mail thru href</title>

<a href="">

<p>mailit</a> </p>
the above solution worked with ie4+ outlook as email editor
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

toffAuthor Commented:
Didn't work. I'm using Netscape 4 (browser and email). I tried the following:
<a href="">

on clicking it, i got an empty email message come up addressed to:

If there's white space in the subject or body, it breaks the string there and gives two addresses, eg:
<a href=" testing&body=messagebody">


(two different addressees on the one email).
toffAuthor Commented:
Didn't work. I'm using Netscape (browser and email). I did the above and got an email addressed to:

which wasn't quite the intent.
toffAuthor Commented:
oops, sorry, the email i got was, of course, addressed to:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.