29

<a href="mailto:office@something.com?subject=Whatever%20this%20is &body=HowcanIaddLine<br/>Break here

I wonder if it is possible to write something like %20 (which stands for a space) for a line-break as well. So I want to have separate lines in my body of the e-mail.

Any ideas?

TylerH
  • 20,816
  • 57
  • 73
  • 92
matt
  • 40,185
  • 99
  • 257
  • 397

2 Answers2

38

You should use a carriage return %0D and line feed %0A

<a href="mailto:endpointadress@something.com?cc=endpointadress2@something.com&subject=your subject&body=Text before new line.%0D%0AText after new line.">create email</a>

This is defined in RFC2368 and is the only valid method of generating a line-break.

Community
  • 1
  • 1
MikroDel
  • 6,569
  • 7
  • 38
  • 70
7

Replace \n (and \r\n) by %0D%0A as specified by RFC6068 (in section 5) updating the mailto URI Scheme as of October 2010 (replacing RFC2368).

[...] line breaks in the body of a message MUST be encoded with "%0D%0A".
Implementations MAY add a final line break to the body of a message even if there is no trailing "%0D%0A" in the body [...]

This is the example from the RFC (in section 6)

<mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index>

The above mail body corresponds to:

send current-issue
send index
Community
  • 1
  • 1
oHo
  • 46,029
  • 27
  • 151
  • 189