[Zope] email in zope: Message missing SMTP Header 'From'

Kate Legere klegere at kfpl.ca
Wed Nov 12 09:39:03 EST 2003


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">&nbsp;</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">&nbsp;
    </td>
    <td width="50%" bgcolor="#C0C0C0">&nbsp;
      <p>&nbsp; </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>
      &nbsp;  <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 at 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




More information about the Zope mailing list