auto-populate subject and body line in mailto link May
21
1
0

Sometimes I need to auto-populate the subject and body lines inside a mailto link. All you need to do is attach the <subject> and <body> as GET variables.

<a href="mailto:test@example.com?subject=Your subject goes here.&body=Place the body text here.">Send me an email</a>

You can omit the email address if you want the user to be able to choose who she wants to send this to.

<a href="mailto:?subject=Your subject goes here.&body=Place the body text here.">Send me an email</a>
Bookmark and Share
blog comments powered by Disqus