How can I send an HTML email with JavaScript from Gmail or Yahoo! Mail, to Gmail or Yahoo! Mail?

2 Answers 2


You shouldn't - allowing JavaScript to run in a e-mail client would be a huge security risk.

I originally said "you can't" but it's been pointed out that some clients will execute the Javascript. So, hopefully Gmail and Yahoomail don't allow scripting for this very reason.

On a personal note, I think HTML in e-mails should be avoided to. What's wrong with plain text?

  • 1
    Sadly, many HTML capable mail clients will execute the Javascript.
    – Cry Havok
    Commented Oct 28, 2010 at 11:48
  • @Cry Havok - perhaps I should change the answer to "You shouldn't".
    – ChrisF
    Commented Oct 28, 2010 at 11:55
  • 2
    @Cry Havok name one.
    – Pekka
    Commented Oct 28, 2010 at 12:00
  • @Pekka, older version of Outlook Express did ISTR (since they just hooked IE) and I've a feeling Outlook did too once. Haven't checked recently whether that's still the case.
    – Cry Havok
    Commented Oct 28, 2010 at 13:18
  • 2
    "What's wrong with plain text?" - The same thing that's wrong with plain text web pages.
    – SooDesuNe
    Commented Oct 30, 2010 at 19:37

Send a link to a web page and request that they manually click the link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.