Advanced email links

Adding an email mailto: link with subject, message body and multiple recipients

One of the most powerful tools in your marketing armoury is email. You will want the recipient to respond to your message in some way, so it makes sense to make this as easy as possible for them by fitting in with their way of working. One way to help ensure the recipients response is to create a link that they can click so that a new reply message opens up, pre-filled in for them, in their own email client.

 

HTML can be added to an email in much the same way as a regular web page (with caveats, so perhaps I shall write on this subject soon) and of course, this HTML will almost certainly include links that will take the recipient either to your website or elicits an email reply.

It's easy enough to add an email reply link into an email using mailto:, but it will be a much more effective tool if you also pre-fill in a subject heading, the message text and any multiple recipients, including cc'ed and even bcc'ed recipients, automatically to the reply.

This example creates an 'Add me to your newsletter' link to an email message. When the user clicks on the link, a new reply message will open in their email client. I want the reply message subject text to say 'Send newsletter quick' and the message body to say 'Dear Company Name, Would you please add me to your monthly newsletter mailing list. Thank you.' Not only that, but I want it to be addressed to multiple recipients.

Most current email clients have some form of 'insert HTML' function. You will need to open a new message and click on the message body before it will be available to you. Type or paste in a standard HTML email link like the one below.

    <a href="mailto:This email address is being protected from spambots. You need JavaScript enabled to view it.">
        Add me to your newsletter
    </a>

If you want to send the email to multiple recipients, comma separate each extra email address like this

    <a href="mailto:This email address is being protected from spambots. You need JavaScript enabled to view it.,This email address is being protected from spambots. You need JavaScript enabled to view it.">
        Add me to your newsletter
    </a>

Next let's add the pre-fill subject text for the reply message. This is done by adding the Subject parameter using the ? operator which tells the email client that there are parameters to follow. Like this -

    <a href="mailto:This email address is being protected from spambots. You need JavaScript enabled to view it.?Subject=Send newsletter quick">
       Add me to your newsletter
    </a>

Now let's add a message body text. This is separated from the previous parameter using the & operator

    <a href="mailto:This email address is being protected from spambots. You need JavaScript enabled to view it.
        ?Subject=Send newsletter quick
        &Body=Dear Company Name, Would you please add me to 
        your mailing list. Thank you.">
        Add me to your newsletter
    </a>

Note that I have laid out these examples for easier reading, but in reality they should be completely unformatted.

You may also add further email recipients to this message by adding any of the To, Cc and Bcc parameters

    &To=This email address is being protected from spambots. You need JavaScript enabled to view it.
    &Cc=This email address is being protected from spambots. You need JavaScript enabled to view it.
    &Bcc=This email address is being protected from spambots. You need JavaScript enabled to view it.

Lastly, there are several characters we are not actually allowed to use in this email link. Email links don't allow spaces between words. A bit of a nuisance, but we get round this by replacing each space with the code %20. It looks a little odd, but your computer has no eye for elegance. The new line/carriage return character is also not allowed so replace these with %0D%0A. It's easy to get into a bit of a muddle doing this, so the 'find and replace' tool (normally invoked using ctrl-H) is invaluable for this purpose.

Because this is an HTML link, the HTML rules apply about certain disallowed 'special' characters. These must be replaced with HTML special character codes. These disallowed characters include the & operator, which needs to be replaced with the special character code &amp;. If there are any quote marks in your text, then they also need to be replaced with the relevant special character code &quote;.

Below is what our complete piece of HTML looks like once we have replaced all the disallowed characters. I have coloured them red for ease of reading -

    <a href="mailto:This email address is being protected from spambots. You need JavaScript enabled to view it.,This email address is being protected from spambots. You need JavaScript enabled to view it. 
        ?Subject=Send%20newsletter%20quick
	&amp;Body=%0D%0ADear%20Newsletter%20Team,%0D%0A%0D%0A
	Would%20you%20please%20add%20me%20to%20your%20
	monthly%20newsletter%20mailing%20list.%0D%0A%0D%0AThank%20you.
        &amp;Cc=This email address is being protected from spambots. You need JavaScript enabled to view it.
        &amp;Bcc=This email address is being protected from spambots. You need JavaScript enabled to view it."> Add me to your newsletter 
    </a>

Make sure that you have not included any formatting (unlike this example here which has been line-wrapped for clarity) and there should be no spaces left whatsoever. Be aware that some recipients use email clients that still only support HTML prior to version 4.0. This means that use of CSS may not be an option.

Here is the new mail message that results from the user clicking our mailto email reply link -

Example of an email created by the above mailto link

That's all there is to using mailto. Using it judiciously will help improve the return on your mail-outs.

On a final note, mailto is not recommended for your internet web pages unless you have obscured any email address from malicious web-bots by some means. A better option is to create a message form that is processed on the server.