How to enter line break into mailto body command

Guess no one asked me this before and I didn’t run into this question yet. However, today I got approached with the question how line breaks can be entered in a mailto: command.
The answer can be found in RFC 2368 whereas line breaks in the body of a message must be encoded using the %0D%0A sequence, which in case is nothing else then hexadecimal for 10 (line feed) and 13 (carriage return).
A full mailto: command using this feature could look like this:

mailto:name@domain.e_t?subject=Header&body=This is the first line%0D%0AThis is the second

Strictly speaking should the white spaces also be replaced with the appropriate ASCII code which is %20 and makes the complete command to look like this:

mailto:name@domain.e_t?subject=Header&body=This%20is...
%20the%20first%20line%0D%0AThis
%20is%20the%20second

15 Responses to “How to enter line break into mailto body command”

  1. Ana Says:

    thanks a lot.. this is what I need..been searching how to make a line break..:)

  2. stephen Says:

    thank you – i used you body comments right away here.

  3. Erwin Sigterman Says:

    I was looking for the breaks in the body and I found it here! Thanx!

  4. Sridhar Unni Says:

    This came as the top search result in google when I searched for “enter in mailto” and it truely deserves it. Thanks a lot….used this instantaneously.

  5. Lazar Says:

    Awesome! I’m just starting out with HTML and was really curious how to accomplish this! Thanks a lot!

  6. kalyan Says:

    Hi,, It works fine with IE6 browser installed on my machine. But If IE8 is installed then every thing comes in single line without any line break.

  7. Victor Says:

    Thanks

  8. garywaddell.com | mailto: Adding Line Breaks in the Body Says:

    [...] http://www.cubetoon.com/2008/how-to-enter-line-break-into-mailto-body-command/ [...]

  9. wilson joel Says:

    Thank you!

  10. Jessica Says:

    Thank you very much..This is what i really want..

  11. neoken Says:

    is there a way to put links inside the body copy?

  12. kio21 Says:

    Thanks!
    simple and working :-)

  13. Mere Says:

    Thanks so much! Just what I needed to create a simple form via mailto :)

  14. Rayda Franken Says:

    Hero ;) thanks

  15. priti Says:

    %0D%0A is not working with default yahoo mail client

Leave a Reply


Creative Commons Attribution-NonCommercial 3.0 Unported
This work by cubetoon is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported.