spacer
Yehuda Shiran October 23, 2000
Adding New Lines to A mailto: URL
Tips: October 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

The mailto: URL lets you specify a full mail message. For example, the following HTML code:

<A HREF="mailto:tomer@netscent.com?cc=yehuda@internet.com&
bcc=tomer@internet.com&subject=Your Tips">Your Feedback is Always Appreciated.</A>

creates the following link: Your Feedback is Always Appreciated. Try it out.

But what if you want to have paragraphs in your mail message. How do you add new lines to the body? The answer is: hexadecimal. All but alphanumeric characters should be converted to hexadecimal representation, using the escape() method. Even better, you can use our Mailtool to enter all the mail message fields. Try composing a message of your own. Add some new lines in the body's text area. Click the Create URL button, and examine the output URL. You can see that each new line is converted into %0D%0A. This is the Carriage Return (%0D) and Line Feed (%0A) that are inserted into the page when you hit the Enter key. So now you know what to do when you need to add a new line. Just add "%0D%0A", or even better, use the Mailtool.

Learn more about the mailto: URL in Column 70, The Mailtool.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint