mailto link multiple body lines

KevinDeus picture KevinDeus · Apr 27, 2012 · Viewed 99.4k times · Source

having trouble getting multiple lines to work correctly in a mailto link

In my case I'm testing it with an Outlook default mail reader.

The following is put in an anchor href:

mailto:[email protected]?&subject=test&body=type%20your&body=message%20here

only "message here" shows up in the email body. (whether I use chrome or IE)

thoughts?

Answer

cyang picture cyang · Apr 27, 2012

You can use URL encoding to encode the newline as %0A.

mailto:[email protected]?subject=test&body=type%20your%0Amessage%20here

While the above appears to work in many cases, user olibre points out that the RFC governing the mailto URI scheme specifies that %0D%0A (carriage return + line feed) should be used instead of %0A (line feed). See also: Newline Representations.