{"id":5732,"date":"2010-02-23T13:37:38","date_gmt":"2010-02-23T20:37:38","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=5732"},"modified":"2021-06-09T09:49:42","modified_gmt":"2021-06-09T16:49:42","slug":"mailto-links","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/snippets\/html\/mailto-links\/","title":{"rendered":"Mailto Links"},"content":{"rendered":"

Basic<\/h4>\n\n\n

Open default mail program, create new message with the TO field already filled out.<\/p>\n\n\n\n

<a href=\"mailto:someone@yoursite.com\">Email Us<\/a>  <\/code><\/pre>\n\n\n

Adding a subject<\/h4>\n\n\n

Open default mail program, create new message with the TO and SUBJECT field already filled out. Essentially we are adding the parameter subject<\/tt> to the href value.<\/p>\n\n\n\n

Spaces in the subject will probably work OK, but to be super-extra sure, you can replace spaces with “%20”.<\/p>\n\n\n\n

<a href=\"mailto:someone@yoursite.com?subject=Mail from Our Site\">Email Us<\/a>  <\/code><\/pre>\n\n\n

Adding CC and BCC<\/h4>\n\n\n

Open default mail program, create new message with the TO, SUBJECT, CC, and BCC field already filled out. Essentially we are adding the parameters cc<\/tt> and bcc<\/tt> to the href value.<\/p>\n\n\n\n

Also note that you add multiple values to CC and BCC by comma separating them.<\/p>\n\n\n\n

<a href=\"mailto:someone@yoursite.com?cc=someoneelse@theirsite.com, another@thatsite.com, me@mysite.com&bcc=lastperson@theirsite.com&subject=Big%20News\">Email Us<\/a><\/code><\/pre>\n\n\n

Adding body text<\/h4>\n\n\n

Just add the body<\/tt> parameter into the ever-growing list of parameters we are using.<\/p>\n\n\n\n

<a href=\"mailto:someone@yoursite.com?cc=someoneelse@theirsite.com, another@thatsite.com, me@mysite.com&bcc=lastperson@theirsite.com&subject=Big%20News&body=Body-goes-here\">Email Us<\/a><\/code><\/pre>\n\n\n

Demo<\/h3>\n\n\n

The following is a demo of different email link usage. The links will not trigger in the embedded demo, but you can see them in action in the full page view<\/a>.<\/p>\n\n\n\n