Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Automatic email link

Posted on 1999-06-24
6
Medium Priority
?
179 Views
Last Modified: 2010-04-09
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="mailto:me@my.place.com">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?
0
Comment
Question by:toff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Expert Comment

by:maniks
ID: 1851180
Try this:: this would definitely solve your problem::
<html>

<head>
<title>mail thru href</title>
</head>

<body>
<a href="mailto:me@my.place.com&subject=testsubject&body=testmessage">

<p>mailit</a> </p>
</body>
</html>
0
 

Expert Comment

by:maniks
ID: 1851181
the above solution worked with ie4+ outlook as email editor
0
 

Author Comment

by:toff
ID: 1851182
Didn't work. I'm using Netscape 4 (browser and email). I tried the following:
<a href="mailto:toff@earthling.net&subject=testing&body=messagebody">

on clicking it, i got an empty email message come up addressed to:
toff@earthling.net&subject=testing&body=messagebody

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

gave
toff@earthling.net&subject=some
testing&body=messagebody

(two different addressees on the one email).
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:toff
ID: 1851183
Didn't work. I'm using Netscape (browser and email). I did the above and got an email addressed to:

mailto:me@my.place.com&subject=testsubject&body=testmessage

which wasn't quite the intent.
0
 

Author Comment

by:toff
ID: 1851184
oops, sorry, the email i got was, of course, addressed to:

me@my.place.com&subject=testsubject&body=testmessage
0
 
LVL 1

Accepted Solution

by:
figueira earned 1560 total points
ID: 1851185
You can use the following javascript function to do the job:

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

That worked fine with NS 4.08 and IE 4.0.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question