Automatically open default email client and pre-populate content

As described by RFC 6068, mailto allows you to specify subject and body, as well as cc fields. For example: mailto:username@example.com?subject=Subject&body=message%20goes%20here User doesn’t need to click a link if you force it to be opened with JavaScript window.location.href = “mailto:user@example.com?subject=Subject&body=message%20goes%20here”; Be aware that there is no single, standard way in which browsers/email clients handle mailto … Read more

mailto link multiple body lines

You can use URL encoding to encode the newline as %0A. mailto:email@address.com?subject=test&body=type%20your%0Amessage%20here While the above appears to work in many cases, user olibre points out that the RFC governing the mailto URI scheme specifies that %0D%0A (carriage return + line feed) should be used instead of %0A (line feed). See also: Newline Representations.

Insert a line break in mailto body

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. <a href=”https://stackoverflow.com/questions/22765834/mailto:email@mycompany.com?subject=Subscribe&body=Lastame%20%3A%0D%0AFirstname%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> You will likely want to take out … Read more

mailto link with HTML body

As you can see in RFC 6068, this is not possible at all: The special <hfname> “body” indicates that the associated <hfvalue> is the body of the message. The “body” field value is intended to contain the content for the first text/plain body part of the message. The “body” pseudo header field is primarily intended … Read more

Can I set subject/content of email using mailto:?

Yes, look all tips and tricks with mailto: http://www.angelfire.com/dc/html-webmaster/mailto.htm mailto subject example: <a href=”https://stackoverflow.com/questions/4782068/mailto:no-one@snai1mai1.com?subject=free chocolate”>example</a> mailto with content: <a href=”mailto:no-one@snai1mai1.com?subject=look at this website&body=Hi,I found this website and thought you might like it http://www.geocities.com/wowhtml/”>tell a friend</a> As alluded to in the comments, both subject and body must be escaped properly. Use encodeURIComponent(subject) on each, rather than … Read more

tech