質問

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