<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Lennart Regebro wrote:
<blockquote cite="mid319e029f0509080158c3ce1e0@mail.gmail.com"
 type="cite">
  <pre wrap="">On 9/8/05, Georgakopoulos Nicolas <a class="moz-txt-link-rfc2396E" href="mailto:nicolasg@vtrip.net">&lt;nicolasg@vtrip.net&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Can some one help out how to set up a ZTP form to use a mailhost object
and send a email with the data that the form was filled ?
I have made the form successfully , my problem is that I don't know how
to use the mailhost.

ps:Can I use a web mail account to send a mail like gmail ?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
No, you need to configure it to use your mail server for outgoing mail.

When this is done, you send the mail with the mailhost send function.
It's quite easy really. Make a little python script that takes the
form and calls MailHost.send.

  </pre>
</blockquote>
I have write the script :<br>
<br>
# locate the mailhost<br>
mailhost=container['mailhost']<br>
<br>
# email message settings<br>
recipient='<a class="moz-txt-link-abbreviated" href="mailto:nicolasg@gmail.com">nicolasg@gmail.com</a>'<br>
sender='<a class="moz-txt-link-abbreviated" href="mailto:nicolasg@gmail.com">nicolasg@gmail.com</a>'<br>
subject='A test mail'<br>
<br>
# format the email message<br>
message='Hello by mail ! '<br>
<br>
# send the message<br>
mailhost.simple_send(recipient, sender, subject, message)<br>
<br>
# return a confirmation message<br>
page=container['thanks.html']<br>
return page()<br>
<br>
When I try to send mail the browser keep waiting for data response ,
and never take a response.I use netstat and check that a connection is
established with my SMTP address. I guess that my problem for the
moment is that I can't pass throu an SSL connection (my smtp server use
SSL) and I cant find a way on mailhost object to change the set SSL .
Does mailhost object or ZOPE support SSL connections for SMTP protocol ?<br>
</body>
</html>