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

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
ActiveState Debuts Open Source Business Suite
Salesforce Offers Visual App Builder
Codesion Steps Out From CVS's Shadow

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:


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Use Web Caching to Make Your Web Site Faster · Creating an Online Shopping Cart Mechanism in PHP · Log JavaScript Errors Using an AJAX-driven Web Service
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags