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?

有帮助吗?

解决方案

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>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top