I would like to insert a line break into my mailto body. I tried %0A, %0D and %0D%0A. Nothing worked for me. I tested on Gmail, Yahoo, Apple Mail, Outlook 2010, Outlook.com and Thunderbird with Google Chrome on Mac OSX.
Any help please ?
Here's my code :
<a href="mailto:email@mycompany.com?subject=Subscribe&body=Lastame%20%3A%0D%0A%20Firstname%20%3A"><img alt="Subscribe" class="center" height="50" src="subscribe.png" style="width: 137px; height: 50px; color: #4da6f7; font-size: 20px; display: block;" width="137"></a>
As per RFC2368 which defines
mailto:
, further reinforced by an example in RFC1738, it is explicitly stated that the only valid way to generate a line break is with%0D%0A
.This also applies to all url schemes such as gopher, smtp, sdp, imap, ldap, etc..
for plaintext email - use "\r" .
like : "this is my test\rthis is my test\ryes it is"; it will give 3 lines in email, like below
line 1 : this is my test
line 2 : this is my test
line 3 : yes it is
I would suggest you try the html tag
<br>
, in case your marketing application will recognize it.I use
%0D%0A
. This should work as long as the email is HTML formatted.You will likely want to take out the %20 before Firstname, otherwise you will have a space as the first character on the next line.
A note, when I tested this with your code, it worked (along with some extra spacing). Are you using a mail client that doesn't allow HTML formatting?