HTML code to open an email window with subject + body copy

Click on this link to see what the code below can do for you. Add it to your posts when you want email responses. Enjoy this little find.

<a href=”mailto:joe%40joehageonline%2ecom?subject=Thanks for the HTML code&body=Dearest Joe Hage post reader, %0A%0AJust hit SEND to let me know you stopped by and found this useful.%0A%0AAdd a personal note below if you like.%0A%0AThanks!%0A%0AJoe Hage”> this link </a>

Of course, just change the words “this link” to whatever you want the hyperlink to say. “This link” could also be an image.


  1. You should not add your actual email address, since spam-bots troll for this. You should translate it into symbolic language. I can show you how later.

  2. Hmmm. Interesting. Does that mean you don’t recommend using mailto: at all?

    Very intrigued. If it’s a nugget, write better code in the comments. If it’s longer, you’re welcome to guest post about it.

  3. Simple bots look for the at-sign (@) and/or the dot (.) when they troll for email addresses. A quick workaround for that is to use the HTML symbolic representation of %40 and %2E. Just as your example already used symbolics to simulate END-OF-LINE and ENTER, this simulates (or in our case, hides) the use of the at-sign and dot.

    Your example above would only slightly change.

    A snippet of code at the begining of the example above is:


    I suggest we change that to:


    (btw – you can quickly verify your code by hovering over the link and looking in the message area of the status bar. IE translates it, then shows it to you.)

    You can find other cool HTML codes at

  4. John, this is great. I went in and changed the post to incorporate your code so future readers can just pick up the code, even if they don’t scroll down to these comments.


  5. I am not a technical person, but have a technical question. Challenge you guys on this one. We use Constant Contact to send out an e-newsletter daily. The newer versions of MS Outlook won’t show the animated gifs, plus in Yahoo and other email programs there is some distortion from the original. SO, I want to use either the web browser page or a link to the e-newletter on our website. However, is there HTML code that will open the link when the email opens — not open the email and then click a link? You will be my hero if you can pull this one off.

  6. Carol, this is very difficult.

    I am changing my email provider to AWeber because I believe I’ll have a better chance of having images served to my subscribers. There is no amount of “Safe Sender” that will make images render if every email you send out comes from a different virtual address.

    Send a note to the Two Hour Blogger and see if he can help you.

  7. I really appreciate your answer — even though it was not the answer I was hoping for. Do you freelance? We are a small firm and anticipate some upcoming programming and design needs. We are in the Cleveland, OH area.

  8. Thank you, Carol. Yes, let’s talk.

  9. Hi Joe, I’m trying to use this on a navbar where I need to insert a url….do you know if this is possible? Thanks so much!! Kelly

  10. Kelly, sorry for the delayed response. I do not completely understand your question.

    Are you asking if there is a link that would open up a URL in a new window?

  11. Felicia says:

    thank you so much for this!!! Saved me a lot of time and probably a headache of two! You guys are awesome!

  12. Hi! nice tutorial

    Btw how about open email link in a new window?

    Thanks guys
    I’m looking forward for positive answer

  13. Hi joe,

    Since i am not a technical person, i thought it would take me so much time to implement it. Thanks for your wonderful blog. i did in a minute. Awesome. keep going

  14. hi Joe,

    is there a way that, instead of a “word”(text to be exact) in the body of the mail it would attach a image uploaded in the a server.


    when i click the button it would pop out email client with an image(from a server) attach to the mail..

    appreciate if this is possible..

  15. Dapogz, that’s a good question! I’m afraid I don’t know the answer, though.

    If you find out, please come back and let us know? Thanks!

  16. Thanks, very helpful.

    Do you know how to open the mail window in a new tab?

    Thanks again!

  17. Hi Dapogz,

    I have a similar requirement to attach a file. Did you figure out a way?


  18. A few have asked if there is a way to open the email in a new window.

    It’s the only way I know how! I have Microsoft Outlook so it automatically opens in Outlook. You can try the code target=”_blank” which means “open in a new window.” Report back if it works for you.

    Vanitha, I don’t know how to attach a file but you could save that file as a PDF on your server. Then, in the body of your email, include a link to that download.


Speak Your Mind


− 5 = 1