Question

I am trying to make a HTML email link and in the body I am trying to start a new line but I do not know how to do this. This is my code:

<a href="mailto:youremail.yahoo.com?subject=Email
 &body=This is an email. This is a new paragraph.">Click to send email</a>

I want the email body to start a new line between "This is an email." and "This is a new paragraph". How do I do this?

Was it helpful?

Solution

You need to use the hex representation of carriage return (%0D) and line feed (%0A)

There's not guarantee that your user will have HTML set as the default style in the email application.

<a href="mailto:youremail.yahoo.com?subject=Email
&body=This is an email.%0D%0AThis is a new paragraph.">Click to send email</a>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top