HTML and javascript in e-mails

  • Thread starter Thread starter Derrick
  • Start date Start date
D

Derrick

Hi,

I am trying to create hyperlinks in an HTML e-mail that links to a web site.
Since there will be several of these hyperlinks in a single e-mail, I have
created a javascript function that accepts the link-specific parameters,
sets hidden fields on a common form to the parameter values, and submits the
common form (code snippet at the bottom of this post). While this works
correctly outside of Outlook, no behavior occurs within an e-mail when the
hyperlink is clicked.

My suspicion is that the javascript is being blocked by Outlook. What
tricks or techniques can I use to get around this issue?

TIA,
Derrick

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
code snippet
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>

<head>
<STYLE></STYLE>
<script language="JavaScript">
function Foo(userID, password)
{
document.Form1.hiddenUserID.value = userID;
document.Form1.hiddenPassword.value = password;
document.Form1.submit();
}
</script>
</head>

<BODY bgColor=#ffffff>
<FONT face="Courier New, Courier"size=3>
<PRE>
<FORM name="Form1"
action="http://localhost/WebDrilldown/Webform1.aspx" method="post">

<A onclick="Foo('fred', 'flintstone')" href="#"> Click me </A>

<INPUT style="WIDTH: 96px; HEIGHT: 22px" type=hidden size=12
name=hiddenUserID>
<INPUT style="WIDTH: 96px; HEIGHT: 22px" type=hidden size=12
name=hiddenPassword>

</FORM>
</PRE>
</FONT>
</BODY>
</HTML>
 
For obvious security reasons, Outlook does not run script in HTML messages.
While it is possible for a user to load an individual message into the
Internet Zone (a security zone defined in IE), using the View | View in
Internet Zone command, most users will not discover this command and will be
wise enough not to use it. You may want to rethink your approach.
 
Back
Top