HTML 'mailto' with subject and multi-line body example ~ Web CodeHelpers

HTML 'mailto' with subject and multi-line body example

In this article i am going to explain about HTML mailto link with structured body

mailto link will use the html anchor tag

sample code
<a href="">Send Mail</a>

to use mailto link in advanced we will use the below notions

NotationMeaning  (for understanding purposes)
?Appears just after the email address, separating it from the first name/value pair.
=Separates each name and value, in the form  name=value.
&Separates name/value pairs, as in  name1=value1&name2=value2.
%Precedes an ASCII character code in hexadecimal, in the form  %xx,  as a way of representing that character. For example,  %0A   represents a newline (line feed) character.
+Another way to represent a space. For example, the value  Bjorn Free  could appear in the URL as   Bjorn+Free.

mailto with cc and bcc - sample code below 

<a  href="">Send Mail</a>

Live Demo : Send Mail

mailto with subject - sample code below 

<a href=" Help" target="_top">
Send Mail</a>

Live Demo : Send Mail

mailto with subject and body  - sample code below

<a href=" Help&body=Mail Body" target="_top">
Send Mail</a>

Live Demo : Send Mail

the above two scenarios will work for us all most , but some times we need to send the structured  body data like below

Hello "Name" We are very happy for visiting our website portal, which is providing useful information , code snippets and live examples. We also providing Interview tip to all the freshers in web development and experienced people also Thanks, Team
To achieve the above scenarios we need to use the HTML URL Encoding References
HTML URL Encoding References for Space  == %20
HTML URL Encoding References for New Line (Line Feed)  == %0A

mailto with subject and structured body sample code

<A HREF="">Check Mail</A>

Live Demo  : Check Mail

* Please Like page to promote us
* Please leave your feedback as comments


  1. can we add anchor tag, in mailto body

  2. Hi,
    the following code not take the encoded character that is particulerly for "line break" in zoho mail.

    pls give alternate solution for that line break(i.e new line )


Subscribe updates via Email