How to Use the Mailto Syntax - Examples

H
Published in: email

The mailto protocol lets you create hyperlinks that will directly launch the default email software and compose a new email message. Mailto commands in Firefox and Chrome even work with web mail programs like Gmail.

You probably know how to use the mailto command for quickly linking to one email address but the mailto syntax actually allows a lot more - you can address the same message to multiple addresses, populate the cc, bcc or subject fields, and even write text inside the email body.

Remember to use %20 for the space character and %0A to add a line break in the body text. You can also test any mailto command by directly typing the command in your browser’s address bar.

Master the mailto Syntax

Let’s assume you maintain the official Whitehouse website and need to create mailto links that will make it easy for visitors to reach the president via email.

1. Send an email to Barack Obama (single recipient)

<a href="mailto:obama@whitehouse.gov">

2. Send an email to Barack and Michelle Obama (separate multiple recipients with a comma)

<a href="mailto:obama@whitehouse.gov,michelle@whitehouse.gov">

3. Send an email to Barack but put Michelle in the CC: list and Joe Biden in the BCC: list

<a href="mailto:obama@whitehouse.gov?cc=michelle@whitehouse.gov&bcc=joe@whitehouse.gov">

4. Send an email to Barack Obama with the subject “Congrats Obama”

<a href="mailto:obama@whitehouse.gov?subject=Congrats%20Obama">

5. Send an email to Barack Obama with the subject “Congrats Obama” and some text in the body of the email message

<a href="mailto:obama@whitehouse.gov?subject=Congrats%20Obama&body=Enjoy%20your%20stay%0ARegards%20">

You may use any permutations and combinations while writing a mailto hyperlink but make sure that there’s only one ? character.

📮  Subscribe to our Email Newsletter for Google tips and tutorials!
Published in: email

Looking for something? Find here!

Meet the Author

Web Geek, Google Developer Expert
A
Amit Agarwal

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. He is the developer of Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Get in touch

Google Add-ons

Do more with your Gmail and GSuite account
G

We build bespoke solutions that use the capabilities and the features of Google Workspace for automating business processes and driving work productivity.

  1. Mail Merge with Attachments
    Send personalized email to your Google Contact with a Google Sheet and Gmail
  2. Save Emails and Attachments
    Download email messages and file attachments from Gmail to your Google Drive
  3. Google Forms Email Notifications
    Send email notifications to multiple people when a new Google Form is submitted
  4. Document Studio
    Create beautiful pixel perfect documents merging data from Google Sheets and Google Forms
  5. Creator Studio for Google Slides
    Turn your Google Slides presentations into animated GIFs and videos for uploading to YouTube