Official website for Web Designer - defining the internet through beautiful design
FOLLOW US ON:
Author: Steve Jenkins
2nd May 2009

HTML tip: Extend the mailto tag

Extend the mailto tag to include predefined subject text, body text and copy in other email recipients

Extend the mailto tag to include predefined subject text, body text and copy in other email recipientsHTML tip: Extend the mailto tag
ADDING AN EMAIL link to a web page in its basic form is simple and straightforward. It’s simply a matter of creating a link with the mailto tag, eg, Send Web
Designer an email
. When the link is clicked, it will open the default email program with the email address already added in the To field.
Extending the capabilities of mailto to include a predefined subject is nothing more than adding a few words of code. Add ?subject=Whatever text is added here appears in the subject field eg, imagine-publishing.co.uk?subject=Whatever text is added here appears in the subject field “>Send Web Designer an email. Now when the link is clicked, the address and subject fields will be populated automatically. This technique is good if the same email address is splashed across all pages of a website. Adding a subject can refer it to a certain section of the website. Adding the next line, &body=Hi From Web Designer”, will add the text into the body of the email”. For example, .uk?subject=Whatever text is added here appears in the subject field&body=Hi From Web Designer”>Send Web Designer an email.
To add additional email addresses into the Cc and Bcc fields, the following code can be tagged on directly after the last word: Hi From Web Designer&cc=portfolio@ imagine-publishing.co.uk &bcc=boss@ imaginepublishing.co.uk”
HTML tip: Extend the mailto tag

Tags: ,
  • Tell a Friend
  • Follow our Twitter to find out about all the latest web development, news, reviews, previews, interviews, features and a whole more.

    2 Comments »

    • Franky said:

      YO!

      This is totally legit. Thanks!

    • Mani said:

      Fantastic….. thanks for post… :)

      Cheers,
      Mani…

    What's your opinion?

    Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

    Be nice. Keep it clean. Stay on topic. No spam.

    * Required fields