# Mailto: How do I make a pre-formatted email?



## wicky (Jul 25, 2005)

I want to launch a pre-written, formatted email using the "mailto" command. 

I know how to create an email with both the subject & the body filled in, but I'm not sure if it is possible to format the body text with line breaks, etc.

Can anybody tell me if this is possible, and how I go about doing it.

Thanks


----------



## mdnky (Jul 25, 2005)

Based on what you've said, you might want to look into doing a form on a webpage and using a PHP or similar script to properly format the message.

Getting the body formated off a mailto link isn't possible, at least not in the manner I think you're trying to do.


----------



## wicky (Jul 25, 2005)

Thanks. I already have a cgi form in place on the site, but the client wants me to have a pre-written email as well. Given the amount of text that will be in the body of the email, I think it will look rubbish if it isn't formatted correctly?

I have never come across a formatted email launched as a maito before, but thought under the right circumstances it would be an interesting tool.


----------



## Pengu (Jul 25, 2005)

um. try putting a \n or \r into the bits where you want a line break.


----------



## wicky (Jul 25, 2005)

No luck, but thanks anyway Pengu. 

However.... Ureka!! I have found the way, and in the interest of shared knowledge here it is..... %0D.

Now, can anybody shed any light on further formatting the text (bold, etc).


----------



## texanpenguin (Jul 25, 2005)

Read:
http://usfweb2.usf.edu/taadocs/mailtoadv.htm


But be aware that mailto: is a dangerous tag to rely upon:
http://www.netmechanic.com/news/vol3/form_no4.htm


Note that the way you are doing it (percent-hex is for specifically inserting the ASCII character associated with that hexadecimal value), you *cannot* format the text.

You can insert all kinds of things into it, but you cannot style it.

You should also be aware that %0D is a carriage-return. %0A, a new-line, is preferable. A horizontal tab is %09, if that helps.

A full list is available at http://www.bbsinc.com/iso8859.html (scroll down a little).

As you can see, you can't insert any ASCII character which means "BOLD".

You should look at sending HTML mail or RTF mail, preferably through a form which has a CGI action (so it doesn't require the user to have an installed e-mail application [or have associated a Hotmail address to a Windows account])


----------



## wicky (Jul 26, 2005)

Thanks Tex.


----------

