How to Add Mailto Links / Including a Subject, CC, BCC and Body Text
The Standard Way
This will open your default mail program and will create a new message with the ‘TO’ field already filled out.
<a href="mailto:[email protected]">Email Us</a>
Adding a Subject
This will open your default mail program and will create a new message with the ‘TO’ and ‘SUBJECT’ field pre-populated. We’re essentially adding the parameter subject to the href value.
Spaces in the subject will probably work just fine, but a better way to add spaces is to replace them with "%20"
.
<a href="mailto:[email protected]?subject=Awesome, the subject is pre-populated">Email Us</a>
<!-- or -->
<a href="mailto:[email protected]?subject=Awesome,%20the%20subject%20is%20pre-populated">Email Us</a>
Adding CC and BCC
This will open your default mail program and create a new message with the ‘TO’, ‘SUBJECT’, ‘CC’, and ‘BCC’ field already filled out. We’re essentially adding the parameters cc and bcc to the href value.
Also, note that you add multiple values to CC and BCC by comma separating them π
<a href="mailto:[email protected][email protected], [email protected], [email protected]&[email protected]&subject=Woohoo,%20We're%20nailing%20it!">Email Us</a>
Adding Body Text
For this one, just add the body parameter into the super long mailto we’ve been creating!
<a href="mailto:[email protected][email protected], [email protected], [email protected]&[email protected]&subject=Woohoo,%20We're%20nailing%20it!&body=Now%20we've%20got%20body%20text,%20pretty%20sweet%20huh?">Email Us</a>
If you’ve reached this point, you’re now a superhero in adding mailto links!
I am looking for an help that make this html coding working also for mobiles.
I have this working well from desktop, but when clicked from mobiles the pre filled fields are bank!!!