html mailto attribute usages

By shaibu chacko

This example allows developer to email their application users from the accessed website using mailto HTML attribute in a Anchor tag.

As we all know that the mailto attribute using in the <A> tag
Example:
<a href="mailo:abc@domain.com">test</A>
And including the subject in the mail message is as follows.
Example:
<a href="mailo:abc@domain.com?subject=test subject">test</A>
The following example opens a Email dialog, where the subject and body of the email are filled with contents we have specified in the mailto attribute.
In this we have to specify the recipients emails id's when the Email dialog opens.
Example:
<A href="mailto:?subject=Error has occurred &body=Hi, This error has occurred during the processing of X operation in the application">Contact Admin</A>
The following example opens a Email dialog with the two email id's in the TO, one email ID in CC and one email Id in the BCC email ID entry section, where the subject and body of the email are filled with contents
we have specified in the mailto attribute.
In this case the emails are sent to all the recipients specified in the TO,CC and BCC email id entry section.
Example:
<a href="mailto:abc@domain.com, abcd@domain.com?subject=Report viewer error&cc=xyz@domain.com&bcc=clientid@domain.com">Contact Admin</A>
Popularity  (1489 Views)
Create New Account
Article Discussion: html mailto tag usages
shaibu chacko posted at Thursday, June 18, 2009 1:53 AM
reply
Spaces in the subject= won't show up
Robbe Morris replied to shaibu chacko at Sunday, October 17, 2010 1:35 AM

you need to encode those spaces with the required special characters.  If memory serves, it is something like 

%20 for a space and %d for new lines. 

reply