Archive for July, 2015

Creating mailto: link

Thursday, July 2nd, 2015

Today I wanted to create a specific link in my responsive (mobile) html design template. When user clicks the link, it should open up the mail client with my desire email addresses, subject, and some text in the body. It was a good idea to CC that email to one or two other email addresses. I searched a lot and here is the final structure I came up with:

 

<a href="mailto:myFirstEmail@example.com? subject=mySubject&body=myLine1%0D%0AmyLine2&cc=test1#example.com;
test2@example.com&bcc=test3@example.com "> Click Here </a>

 

Do not forget to leave key words like mailto, subject, body, cc, and bcc all in lowercase, otherwise they do not work appropriately. 
If you line to have line break in the body, you can easily use %0D%0A


Above format works perfectly on almost all web browsers and mail clients. The only issue is it does not work in mobile Apps appropriately. Any idea ?

* DO NOT USE "#" Inside your mailto link