HOWTO: Mailto and Outlook??

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Hi...

I'm using Outlook XP but pretty sure I had same problem using Outlook 2000.

I've coded my personal website to include a little Javascript MAILTO:
routine using HTML "forms". I've spent several hours this weekend searching
the web for examples and re-coding them into my website. They all SEEM to
work (from the website viewpoint) but whenever I get the "... someone is
trying to use Outlook..." popup the resultant message goes into my Outlook
OUTBOX and NEVER gets sent! This script used to work!

Do I have an Outlook "security" issue?? Or an Internet Explorer concern?
Or is there something NEW that I need to add to my Javascript code to tell
Outlook all's well? Does anyone have a fix? Am I sending this to the wrong
group (and, if so, which group would better serve me on this)?

Thanks in advance,
Steve
 
Steve said:
I've coded my personal website to include a little Javascript MAILTO:
routine using HTML "forms".

Well? Show us, so we can see if ít's the website or some other issue.
 
Hi Rene,

Not sure what you want to see... so I'm including the one sub-page's HTML
(and Javascript)... it's a little long tho (see below)

Thanks!
Steve

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>

<HEAD>
<TITLE>Contact Us (JavaScript Mail Form)</TITLE>
<LINK rev="made" href="mailto:[email protected]">
<META name="author" content="Duncan Crombie">
<SCRIPT language="JavaScript">
<!-- Hide from older browsers

// Original JavaScript code by Duncan Crombie: (e-mail address removed)
// Please acknowledge use of this code by including this header.

function mailIt() {
var dataForm = document.dataForm; // visible form
var mailForm = document.mailForm; // hidden form
var message = dataForm.body.value;

// redefine the mailForm action property
mailForm.action = "mailto:" + dataForm.recipient.value;
mailForm.action += "?subject=" + dataForm.subject.value;

// retrieve location information
var pageTitle = "Page Title: " + document.title;
var sentFrom = "Mailed From: " + document.location;
var userInfo = pageTitle + "\r\n" + sentFrom + "\r\n\r\n";

// transfer all information from dataForm to mailForm for sending
mailForm.mailBody.value = userInfo + message;

// open new window
newWindow = window.open("", "new_Window", "status='yes',
scrollbars='yes'");
newWindow.document.clear();

// create a page that presents the transmitted message
newWindow.document.write("<HTML><HEAD><TITLE>Message sent to " +
dataForm.recipient.value + "</TITLE></HEAD>");
newWindow.document.write("<BLOCKQUOTE>");
newWindow.document.write("<BODY bgcolor='white'>");
newWindow.document.write("<H2>The following message has been
sent:</H2>");
newWindow.document.write("Recipient: " + dataForm.recipient.value +
"<p><hr><p>");
newWindow.document.write(message + "<p>");
newWindow.document.write("<hr><p><DIV align='right'><FORM>");
newWindow.document.write("<INPUT type='button' value=' Close Window '
onClick='window.close();'>");
newWindow.document.write("</FORM></DIV></BLOCKQUOTE></BODY></HTML>");
newWindow.document.close();

// return true to send mail (returning false should prevent submission)
return true;
}

// Stop hiding -->
</SCRIPT>

</HEAD>

<body bgcolor="#ffffcc">
<center>
</center>
<BLOCKQUOTE>
<div align="center">
<font color="#0000FF" size="5" face="Verdana"><em>Contact Us</em></font>
<br>
</div>
<HR noshade size="1">

<DIV align="center">
<TABLE border="0" cellpadding="5" cellspacing="0">
<FORM name="dataForm" method="post">
<!-- The first form is the one that appears on the page -->
<TR><TH align="right">Send Message To: </TH>
<TD><INPUT name="recipient" size="50" value="(e-mail address removed)"></TD>
</TR>

<TR><TH align="right">Subject: </TH>
<TD><INPUT name="subject" size="50" value="Suggestion Box"></TD>
</TR>

<TR><TH align="right" valign="top">Body: </TH>
<TD><TEXTAREA name="body" cols="50" rows="10"
wrap="virtual"></TEXTAREA></TD>
</TR>
</FORM>

<FORM name="mailForm" action="mailto:" method="post" enctype="text/plain"
onSubmit="return mailIt();">
<!-- The contents of this field are filled out when the submit button is
pressed -->
<INPUT type="hidden" name="mailBody" value="">

<TR>
<TD><input name="button" type="button"
onClick="document.dataForm.reset();" value="Reset"></TD>
<TD align="right"><input name="submit" type="submit"
onClick="return(confirm('Send this message to ' +
document.dataForm.recipient.value))" value="Send Message Now";>
&nbsp;</TD>
</TR>
</FORM>
</TABLE>
<br>
</DIV>
<div align="center">
<p></p>
</div>
</BLOCKQUOTE>

</BODY>
</HTML>
 

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

Back
Top