Skip to content

Instantly share code, notes, and snippets.

@mauro-balades
Last active June 12, 2023 09:36
Show Gist options
  • Save mauro-balades/ce9f7d5a104a2fe60fa3c0cb85917594 to your computer and use it in GitHub Desktop.
Save mauro-balades/ce9f7d5a104a2fe60fa3c0cb85917594 to your computer and use it in GitHub Desktop.
mailto URL standard

First of all, what is this?

Mailto is a special type of HTML link. When the client opens this links, it will open the default mail client you have in your computer. The web browser requires a default e-mail client software installed on his computer in order to activate the e-mail client.

How to create a mailto link?

The mailto link must have the mailto: prefix. This prefix will tell the browser that the client is trying to send and email and there for, open the email client. Followed by the prefix, it is required to input the email of the recivient.

e.g. mailto:example@example.com

There are also some extra parameter that can be inserted into the URL link. The first parameter should be prefixed with ? and the rest of parameters with &.

here is a list of possible parameters:

Parameter Description Example
cc carbon copy e-mail address cc=example@example.com
bcc blind carbon copy e-mail address bcc=example@example.com
subject subject of e-mail subject=hello
body body of e-mail body=body text

e.g. mailto:example@example.com?subject=hello&body=this is my new email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment