Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Mailto" function - formatting of BODY text. Is this possible?

Status
Not open for further replies.

MHUK

Programmer
Nov 30, 2002
139
GB
Hi

Please can someone tell me how to format the layout of the BODY of an email in a "mailto" function. I have a website and when someone clicks a hyperlink called "Contact us", it calls the mailto function. This all works fine and brings up the email dialog box with my contact email in the 'sendto' field, and the subject comes up fine too. However I have a problem with formatting the main body. Before the user enters their email I want a couple of instruction lines to appear in the message / body. But I have been having major trouble trying to solve the simple problem of getting two lines of text to appear on top of each other.

This is my mailto function at the moment:
<a href="mailto:test@test.com?subject=Test&body=This is the body of the email. Please write your email here.">

The text appears as follows in one continous line in the BODY:
"This is the body of the email. Please write your email here."


My question is how would you be able to add a 'break' in the text, so the two sentances appear on separate lines?

Example, how would I be able to make the BODY appear as follows:

"This is the body of the email.
Please write your email here."

Where essentially there are is a 'break' (<BR>) after the first sentance. Up to now I have tried using the "Enter/Return" key in the mailto function but it works fine for a couple of words but if it is a long sentance it can't seem to handle it and splits the sentance up. I need to know if there is a set way of handling the simple formatting of how the BODY appears when a 'mailto' function is called.

Thank you for any help. Much appreciated.

MHUK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top