Google Answers Logo
View Question
 
Q: Need HTML code for a more robust mailto link. ( Answered 5 out of 5 stars,   2 Comments )
Question  
Subject: Need HTML code for a more robust mailto link.
Category: Computers > Internet
Asked by: sherpaj-ga
List Price: $15.00
Posted: 03 Oct 2002 20:23 PDT
Expires: 02 Nov 2002 19:23 PST
Question ID: 72286
I want to have a link on my web site, that when clicked will do a
mailto command to make a new email come up in the users email program.
  I want to be able to put stuff in the Subject of the email, and in
the body.    So far, I have figured out how to do one or the other,
but I can’t get both to work.

I would prefer to have the body text be HTML, or at least have live
URLs in it, I am not sure if there is a way to tell the email client
software to generate a new email and make it HTML format.
Answer  
Subject: Re: Need HTML code for a more robust mailto link.
Answered By: websearcher-ga on 03 Oct 2002 21:40 PDT
Rated:5 out of 5 stars
 
Hi sherpaj:

Thank you for the interesting question. Let's split it into two parts.


Part 1: Pre-filling multiple parameters in a mailto command
***********************************************************

The trick to being able to specify both the subject and body of an
email is to separate the two parameters with the "&" character.

For example, the following code:

mailto:researcher@google.com?Subject=Testing&Body=This%20is%20a%20test.

Would create an email to researcher@google.com with the subject of
"Testing" and the body of "This is a test." Of course, this mailto
call has to be enclosed in an <A> tag - but you already know that.

In fact, you can supply more than two parameters using this technique.
For more information, see the following links:

Unleashing the Power of mailto URLs
http://developer.netscape.com/viewsource/husted_mailto/mailto.html
(This page has a real handy little code building form at the bottom.)

MailTo 
http://www.cpcug.org/user/clemenzi/technical/HTML_Examples/MailTo.htm


Part 2: Making the Body Text HTML
*********************************

All the searching I have done has not turned up any way to force a
mailto command to specify that an email message is in HTML format.
From what I've read, the best you can hope for is that the email
client of the person receiving the email will know enough to translate
URLs as links and make them "live" (clickable).

For example, using the form at the bottom of 

http://developer.netscape.com/viewsource/husted_mailto/mailto.html

I added a URL (just the address, not an <A> tag) to the body text of
my mailto command. When this email arrived and I read it with Outlook
Express, the URL was automatically converted to a live link. However,
when I tried to add some other HTML formating (such as <EM> and <I>),
the tags passed through as text and were not converted.


I hope that this has been of help to you. If you need any
clarification, please ask using the Clarification feature - before you
rate this answer.

Thank you. 

websearcher-ga


Search Strategy:

mailto HTML subject body
://www.google.com/search?hl=en&ie=ISO-8859-1&q=mailto+HTML+subject+body

mailto HTML subject body parameters
://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&safe=off&q=mailto+HTML+subject+body+parameters

advanced mailto parameters
://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&safe=off&q=advanced+mailto+parameters

Request for Answer Clarification by sherpaj-ga on 12 Oct 2002 01:53 PDT
I almost got it working.  I can now put text into both the subject and
body, but the problem is that the text in the body is all bunched up. 
 How do I insert some line breaks into there?

Clarification of Answer by websearcher-ga on 12 Oct 2002 13:52 PDT
Hi sherpaj:

Try putting the characters %0D where you want a line break. 

For example: 

mailto:researcher@google.com?Subject=Testing&Body=This%0Dis%20a%0Dtest.

Thanks. 

websearcher-ga

[Thanks go to my fellow Researcher, secret901-ga, for this advice.]
sherpaj-ga rated this answer:5 out of 5 stars
It worked!  On the PC anyway.  On the Mac, I can't get the line breaks
to work.  Any ideas?   I am using IE 5.x on MacOS 9.2.   Also, can you
stear me towards a solution for doing the same thing, except forcing
the email program to make the new email in HTML format.

Comments  
Subject: Re: Need HTML code for a more robust mailto link.
From: bobthedispatcher-ga on 03 Oct 2002 23:32 PDT
 
If you have some experience with html coding
and your host allows cgi files, and has Sendmail or SMTP.
You might consider using an online form to send the mail.
Many web hosting companies offer Form Mail, or a similar script
and a free one I recommend is at
http://bignosebird.com/carchive/bnbform.shtml

a FREE WYSIWYG text editor that can be used in your form
http://www.interactivetools.com/products/htmlarea/
it simply repaces the "textarea" form input
and lets users edit the message in a mannners similar to 
MS Word

You can easily put together a custom form sending a HTML message
that the user can edit as needed
Subject: Re: Need HTML code for a more robust mailto link.
From: websearcher-ga on 17 Oct 2002 11:13 PDT
 
Hi sherpaj:

Thanks for the 5-star rating! :-) 

I'm afraid I don't have/can't find any further information for you.
I've tried, but to no avail.

websearcher-ga

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy