Home > Uncategorized > Master the mailto Syntax

Master the mailto Syntax

January 28th, 2009 Leave a comment Go to comments

Let’s assume you maintain the official Whitehouse website and need to create mailto links that will make it easy for visitors to reach the president via email.

  1. Send an email to Barack Obama (single recipient)
    <a href=“mailto:obama@whitehouse.gov”>
  2. Send an email to Barack and Michelle Obama (separate multiple recipients with a comma)
    <a href=“mailto:obama@whitehouse.gov,michelle@whitehouse.gov”>
  3. Send an email to Barack but put Michelle in the CC: list and Joe Biden in the BCC: list
    <a href=“mailto:obama@whitehouse.gov?cc=michelle@whitehouse.gov&bcc=joe@whitehouse.gov”>
  4. Send an email to Barack Obama with the subject “Congrats Obama”
    <a href=”mailto:obama@whitehouse.gov?subject=Congrats%20Obama”>
  5. Send an email to Barack Obama with the subject “Congrats Obama” and some text in the body of the email message
    <a href=”mailto:obama@whitehouse.gov?subject=Congrats%20Obama&body=Enjoy%20your%20stay%0ARegards%20″>

You may use any permutations and combinations while writing a mailto hyperlink but make sure that there’s only one “?” character.

Link

Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.