How to: Create and Master The “mailto:” Syntax

Time to read: 4 mins
Photo by Brett Jordan on Unsplash
Photo by Brett Jordan on Unsplash

Ever wanted to create a link on a website to open up an email message to send an email to a specific address(es) with a subject and even some text in the email ready to send?

Using the “mailto:” syntax is a great way to achieve this.

Send an email to a single recipient:

mailto:[email protected]

Send an email to more than one recipient:

mailto:[email protected],[email protected]

Send an email to more than one recipient, adding into the “CC” line:

mailto:[email protected][email protected]

Send an email to more than one recipient, adding into the “BC” line:

mailto:[email protected][email protected]

Send an email to more than one recipient, adding into the “CC” & “BC” line:

mailto:[email protected][email protected]&[email protected]

Send an email with a subject line:

mailto:[email protected]?subject=Subject%20Here

Send an email with a subject line and body:

mailto:[email protected]?subject=Subject%20Here&body=Body%20Here

Note:

In the syntax there can only be one “?” character. For Subject and Body where a space is required the correct syntax to add for a space is: %20

For example Subject%20Here

%20 showing the space between “Subject” and “Here”

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.