Easy things to do with MailTo

MailTo is the command you use to create links for sending email. Use this command to let your visitors write you comments, support questions, etc. Here you will see how to use some of the more advanced capabilities of MailTo: setting a default subject, sending to multiple recipients and setting a default message body.

  • In all the following examples, you can replace "Write Me" with your own text.
  • Keep in mind: these commands are just recommendations for the mail programs. The user can change all fields you set.

  • Simple MailTo Command
    A simple MailTo command can be set by using the syntax below in your HTML body:
    <a href="MailTo:Jesus@Heaven.com">Write Me</a>

    More Recipients
    If you want the mail to arrive to more than one address, you can add more using a comma:
    <a href="MailTo:Jesus@Heaven.com,Devil@Hell.com">Write Us</a>

    Subject
    You can recommend a default subject to the user with the following syntax:
    <a href="MailTo:Jesus@Heaven.com?subject=Admission Problem">Write Me</a>

    Message Body
    You can add a text line to the beginning of the message body:
    <a href="MailTo:Jesus@Heaven.com?body=Dear Jesus,">Write Us</a>

    Combining it all
    This example shows you how to combine the lines shown earlier:
    <a href="MailTo:Jesus@Heaven.com,Devil@Hell.com?subject=Imminent Strike&body=Take us to your leader!"> Write Us </a>

    Notes:

  • Only one question mark ('?') should appear in the MailTo line
  • Watch out for spaces between the keyword and the equal sign. Correct way: "?subject=". Incorrect way: "?subject =".
  • Tired of typing? Use the Mailto Link Generator!


    MailTo syntax tutorial - Gilad Israeli, June 2005.
    For more help, write me.