How to use mailto syntax? Complete tutorial with example

Share on facebook
Share on twitter
Share on linkedin

How to use mailto syntax? Complete tutorial with example

Today we are with a complete variety of article. This article helps webmasters and developers to create mailto links on your webpages. Actually mailto syntax is a protocol like HTTP, HTTPS that allows the users to directly mail to the desired email from the default email software of your Computer, Smart Phones. In case of windows, it will run Outlook software automatically when you click on a mailto protocol. You can change the default mail software from outlook to any other customized tools that you want.

Simplest way of using mailto syntax

You may have seen the below example many times. While you are browsing at different webpages, you may see an email address that visible like links. But when we click on it, our default email software popup and allows you to send email directly. This kind of settings are made for providing more user experience.
Simple mailto syntax
<a href=”mailto:yourmail@domain.address“>Mail Us</a>
This will visible in browser page as below
Mail Us
For example if you want to mail to our mail address, our mail id is firstandgeek.com@gmail.com the above syndax will be changed as follows.
<a href=”mailto:firstandgeek.com@gmail.com“>Mail Us</a>
This will visible in browser page as below
Mail Us
Here the mail Us is the visible part. You can change it to your email address, so that your customers can mail to you from external tools. Other wise, they will get confused about your email address. Whenever you use mailto syndax, please do it as follows.
<a href=”mailto:yourmail@domain.address“>yourmail@domain.address</a>
It look likes
yourmail@domain.address

Mailto Syntax if there is multiple Recipients

Gmail-banner
There may be multiple Recipients for some kind of emails. For example if two persons are handling same designation and in your page if you need to add mailto with two recipients here is the syntax.
<a href=”mailto:first@domain.name,second@domain.name,third@domain.name“>Contact Us</a>
Here first@domain.name is the email address of first recipient.
Second@domain.name is the email address of Second recipient.
third@domain.name is the email address of Third recipients.
In the browser page above code will perform like below.
Contact Us

Mailto Syntax if there is a subject Line

<a href=”mailto:your@domain.name?subject=The Subject Part“>Mail Us</a>
The above code is the mailto syntax if there is a subject line by default. In many situation, you need to implement this code in your webpage.  The code will show in a webpage as below.
Mail Us

Mailto Syntax with a cc
If you need to Carbon Copy the email address with mailto syntax, below is the code.
<a href=”mailto:first@domain.name?cc=second@domain.name,third@domain.name“>Mail Us</a>
Syntax including a bcc:
This is the code of including a bcc in mailto syntax
<a href=”mailto:first@domain.name?bcc=second@domain.name,third@domain.name“>Mail Us</a>
Insert a body paragraph in mailto suntax
You may suppose need to insert some body in the email similar to insertion of subject. For that the following is the syntax.
<a href=”mailto:your@domain.name?body=First paragraph.“>Mail Us</a>
This will shown in a browser window as follows
Mail Us
Hope all of you got me. But in our latest technologies to for making websites like dream weaver, ASP.net etc there is no need of by-hearting all this syntax. These tools will automatically leads you for successful email insertion.

Can't get enough freebies? Subscribe to FirstAndGeek

Leave a Comment

Your email address will not be published. Required fields are marked *

SUBSCRIBE TO FIRSTANDGEEK
POPULAR POSTS

Have an app, software or tech product you want us to review?

WHAT IS FIRSTANDGEEK?

A quick simple digest of the top tech stories, delivered right to your inbox!

Contact Us

More Articles

Have an app, software or tech product you want us to review?

We would Love to! Just send US a message.

Subscribe to our newsletter for the latest in tech!

Join Our 23,458 Subscribers

A quick simple digest of the top tech stories, delivered right to your inbox!

We only send really good stuff. Promise.

Scroll to Top