HTML and javascript in e-mails

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

Sue Mosher [MVP-Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top