user279244
user279244

Reputation: 971

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???

Upvotes: 3

Views: 19794

Answers (2)

Tom Gullen
Tom Gullen

Reputation: 61755

Probably not, it depends on mail client but I would be incredibly suprised if I saw any that allowed scripts as this opens the floodgates for huge security compromise risks.

Edit

Your best option would probably be to look at support for iframes, again though, I would be suprised if many mail clients allowed use of this element.

Upvotes: 2

Martijn
Martijn

Reputation: 13632

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.

Upvotes: 5

Related Questions