Developping for the translation industry RSS 2.0



 Wednesday, 12 November 2008

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 in the queryString. As with any other URL, you use the ? to add the query parameters and the & to separate each parameter, which are in the form param=value

Here are the variables you can use in these mailto links:

mailto: to set the recipient, or recipients, separate with comma
cc to set the CC recipient(s)
bcc to set the BCC recipient(s)
subject to set the email subject, URL encode for longer sentences, so replace spaces with %20, etc.
body to set the body of the message, you can add entire sentences here, including line breaks. Line breaks should be converted to %0A.

Some mailto examples

Simple mailto link:

<a href="mailto:info@example.com">mail link</a>

mailto link with subject:

<a href="mailto:info@example.com?subject=email%20subject">mail link</a>

mailto link with multiple recipients:

<a href="mailto:info@example.com,email@example.com">mail link</a>

mailto link with a CC:

<a href="mailto:info@example.com?cc=email2@example.com">mail link</a>

mailto with message body already started:

<a href="mailto:info@example.com?body=these%20mailto%20links%20are%20cool">mail link</a>

mailto with 3 lines of message body:

<a href="mailto:info@example.com?body=these%20mailto%0Alinks%20are%0Acool">mail link</a>

mailto with 3 lines of message body and a BCC:

<a href="mailto:info@example.com?bcc=mail2@example.com&body=these%20mailto%0Alinks%20are%0Acool">mail link</a>

As you can see, you can add as many of these as you want and stack them on top of each other. On top of that, for the code to be valid HTML, you will have to replace every & with &amp;.

Happy mailing!

 

Other posts :

How To: Create an Outlook 2003 addin using VSTO SE and Visual Studio 2005

How to insert a file in an image column in SQL Server 2005

Tools for Web developers

Wednesday, 12 November 2008 13:45:47 (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Code Snippet

Navigation
Advertisement
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2018
Stanislas Biron
Sign In
Statistics
Total Posts: 135
This Year: 0
This Month: 0
This Week: 0
Comments: 1
All Content © 2018, Stanislas Biron