When you compose and send an e-mail message, you may use HTML as a way to improve the presentation. This means you can include some JavaScript to be executed in the client mail reader application.
Not all mail clients can support HTML, let alone JavaScript. However, if your recipient does, then you can do some creative things to generate auto reply messages (security permitting). You can also do animation, play audio, present a form for a survey etc. You simply construct your HTML document in the normal way.
Server-generated mail-outs could use this technique to determine how well targeted the mailing is. Perhaps you could put a subscribe/unsubscribe button on the form and tie that to a user ID. That would get round one of the major difficulties of unsubscribing people, which is to do with the mutations that mail addresses undergo. Periodically, a mail server may move or a domain name may change, and this means that unsubscribing from the new address does not locate the subscription record that was made under an old address. Passing an ID back and forth solves this major headache.
There are significant security and virus related risks with JavaScript enabled e-mail. The possibilities are so catastrophic that the best recommendation is to deactivate JavaScript and Java in any mail reading client application.
Just because something is possible does not mean it is advisable or good to do.
On the other hand, within the confines of a closely controlled Intranet or workgroup, this could find many useful applications. Just so long as you know where the mails came from and you can absolutely trust that they have not been compromised.
Personally, I'd recommend that you turn it off. I've not yet been convinced of the need to support HTML in e-mail correspondence other than for demonstrating how hip and trendy I can be.
See also: | News posts containing JavaScript |
Prev | Home | Next |
E | Up | ECMA |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |