Search code examples
javascriptemailmime-typesmime

How can I add javascript to an the email?


Is it possible to have a ajax button inside email? I want to add a button similar to the buttons inside a google calendar meeting invitation email.

Or is there any alternative option???


Solution

  • Don’t count on it. Most if not all mail clients will refuse to run Javascript within an e-mail.

    If you want to include buttons, insert images with different links to a public web page of yours. Also, do include the button images within the mail message itself (and reference them by Content-ID), since many mail clients nowadays even refuse to load remote images.

    This is exactly what Google Calendar does. Of course, Gmail recognizes invitation attachments (text/calendar), and so provides its own interface for the yes/no/maybe buttons.