How to Use Mailto Links on Your Website

In this article we're taking a look at how to use Mailto links on your website to open up the customers email provider with the to email field auto filled.

Let’s take a look at how to implement Mailto links with your email addresses on your website.

In basic terms this link when clicked opens up the default mail program for example Gmail on your device or your website visitors device. It then populates the To field with the email address specific.

Standard Implementation of Mailto Links:
<a href=”mailto: name@websiteaddress.com”> name@websiteaddress.com </a>


Another example would be to use text that isn’t just the displayed email address:

<a href=”mailto:name@websiteaddress.com”> Send Us An Email </a>
Adding Additional CC and BCC Email Addresses to Mailto:

Sometimes you may need any customer or site emails to be sent to multiple addresses either using CC or BCC.

The structure of this looks like this:

<a href=”mailto:name@websiteaddress.com?cc=anothername@websiteaddress.com, anothername2@websiteaddress.com&bcc=anothername3@websiteaddress.com”> Send Us An Email </a>

In the above example each of the additional CC email addresses is separated by a comma.

To use just CC or Just BCC they would look like this:

CC:

<a href=”mailto:name@websiteaddress.com?cc=anothername@websiteaddress.com> Send Us An Email </a>


BCC:

<a href=”mailto:name@websiteaddress.com?bcc=anothername@websiteaddress.com> Send Us An Email </a>
Adding an Email Subject to Mailto:
<a href=”mailto:name@websiteaddress.com?subject=Email%20From%20Websiteaddress.com”> Send Us An Email</a>


In the above example the spaces are replaced with %20, some email clients may not handle the spaces as spaces in the subject line. Although not particularly common it’s worth using %20.

Further Reading:

How to Use Tel Links on Your Website

Summary:

We hope you found this useful, if so we’d really appreciate a comment a share thanks!

Tech Typed
Tech Typed
Articles: 186

Leave a Reply

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