For a small project, I had to create a smart mailto link to make my life a bit easier. I wanted the mailto link to hold not only a to and the subject (I’d figured that much out) but a multi-lined body too. Turns out that is pretty darn easy to do. So, for my own reference, and yours, here’s a complete overview of everything possible with a mailto link.
There are a couple of variables you can use, which you’d have to do in standard URL format, remember to properly encode the & if you care about the validity of your HTML, so you use & in that case. Here’s the full mailto link syntax:
As you can see, you can add as many of these as you want and stack them on top of each other. Remember that after the email address you’ll use a question mark to prefix the first variable, and ampersands ( & ) for each consecutive variable.
Discussion (29)