email in zope: Message missing SMTP Header 'From'
I am setting up a form that recieves data from a user and then emails that info to me. My form is such: <dtml-var standard_html_header> <html> <head> <title>Ask a Librarian</title> <SCRIPT LANGUAGE="JavaScript"> function validate() { mNv=askForm.name.value; if (mNv=='') { alert('Your name is a required field.'); event.returnValue=false; } mEm=askForm.mail.value; if (mEm=='') { alert('Your email address is a required field.'); event.returnValue=false; } mPh=askForm.phone.value; if (mPh=='') { alert('Your Phone Number is a required field.'); event.returnValue=false; } } </SCRIPT> </head> <body> <table width="70%" bgcolor="#C0C0C0" align="center"> <form name="askForm" method="post" action ="mailer" > <tr height="20"> <td width="100%" bgcolor="#808080" colspan="2"> <p align="left"><b><font size="5" color="#800000"> </font><font color="#800000" size="6">Ask a Librarian</font></b></p> </td> </tr> <tr> <td width="50%" > Name:<input type="text" name="name" size="20" tabindex="1" maxlength="20"> </td> <td width="50%" bgcolor="#C0C0C0"> <p> </td> </tr> <tr> <td width="50%" >Email:<br> <input type="text" name="mail" size="30" tabindex="2" maxlength="40"><br> </td> <td width="50%" bgcolor="#C0C0C0">Phone:<br> <input type="text" name="phone" size="20" tabindex="3" maxlength="10"> </td> </tr> <tr> <td width="100%" colspan="2"><hr> <p align="left">Describe in as much detail as possible what you are looking for:<br> <textarea cols=60 rows=3 name="what" tabindex="4"></textarea><br> </p> <hr> </td> </tr> . . . <tr> <td width="100%" bgcolor="#C0C0C0" colspan="2"> <hr><p align="center"> <input type="reset"><input type="submit" value="Submit question" onClick="validate()"> </p> </td> </tr> </form> </table> </body> </html> <dtml-var standard_html_footer> ------- "mailer" is: <dtml-sendmail smtphost="mail.kfpl.ca"> To: klegere@kfpl.ca From: <dtml-var name> Subject: Ask a Librarian . . . </dtml-sendmail> <h1> Thank you <dtml-var name>! </h1> <p> Your request has been successfully sent </p> <dtml-var standard_html_footer> however when I fill in the form and submit, I get: Error Type: MailHost Error Error Value: Message missing SMTP Header 'From' I *think* I have the From: header filled in here - I've even hard coded it but I still get the error. What have I missed? Kate
"mailer" is:
<dtml-sendmail smtphost="mail.kfpl.ca"> To: klegere@kfpl.ca From: <dtml-var name> Subject: Ask a Librarian . . . </dtml-sendmail>
<h1> Thank you <dtml-var name>! </h1> <p> Your request has been successfully sent </p>
<dtml-var standard_html_footer>
You *must* remove all indentation inside the sendmail tag. jens
On Wed, 2003-11-12 at 06:39, Kate Legere wrote:
"mailer" is:
<dtml-sendmail smtphost="mail.kfpl.ca"> To: klegere@kfpl.ca From: <dtml-var name> Subject: Ask a Librarian . . . </dtml-sendmail>
Don't put extra space before the mail headers. That's why it can't find your "from" field. This isn't HTML you're creating, so different rules apply as to the significance of extra whitespace. HTH, Dylan
participants (3)
-
Dylan Reinhardt -
Jens Vagelpohl -
Kate Legere