[Zope] dtml-sendmail problem

William GARCIA wgarcia@esrf.fr
Thu, 25 Apr 2002 16:10:07 +0200


--=====================_201096859==_.ALT
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
Content-Transfer-Encoding: quoted-printable

I try to send a mail to a user from a form.
When I type my mail in the dtml-code, there is no problem but when I intend=
=20
to use <dtml-var name=3D"mail">,

Zope generate this error :
Error Type: TypeError
Error Value: len() of unsized object

I have try to use smtphost tag instead of mailhost but the error generated=
=20
is the same.
Is it a problem of proxy,port number, or user's permissions which could'nt=
=20
send mail, or only a syntax error??

If somebody know the answer...
Thanks in advance,
William

Here is the code I wrote :
Form (DTML document)
<form action=3D"sendMailUser">
   L'image que vous avez soumise, ainsi que son contenu, vont maintenant=20
=EAtre contr=F4l=E9s par nos managers.<br>
   Saisissez votre e-mail si vous d=E9sirez =EAtre tenu au courant de=
 l'=E9tape=20
de mise en ligne.<br>
  Name : <input name=3Dname size=3D40>
  Email : <input name=3Dmail size=3D40>
  <input type=3D"submit" value=3D"Valider">
</form>

sendMailUser(DTML method)
<dtml-sendmail mailhost=3D"MailHost">
  To: "wgarcia@esrf.fr"
  From: <dtml-var name=3D"mail">
  Subject: ESRF : Image
  Name: <dtml-var name=3D"name">
  Email:<dtml-var name=3D"mail">
  Order:
        Soumission en cours
</dtml-sendmail>

Traceback (innermost last):
   File=20
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line=20
150, in publish_module
   File=20
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line=20
114, in publish
   File /zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Zope/__init__.py,=20
line 159, in zpublisher_exception_hook
     (Object: recherche_indexation)
   File=20
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line=20
98, in publish
   File /zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/mapply.py,=
=20
line 88, in mapply
     (Object: sendMailUser)
   File=20
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line=20
39, in call_object
     (Object: sendMailUser)
   File /zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py,=20
line 127, in __call__
     (Object: sendMailUser)
   File=20
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_String.py,=
=20
line 473, in __call__
     (Object: sendMailUser)
   File=20
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Products/MailHost/SendMailTag.=
py,=20
line 116, in render
     (Object: MailHost)
   File=20
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Products/MailHost/MailHost.py,=
=20
line 156, in send
     (Object: MailHost)
   File=20
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Products/MailHost/MailHost.py,=
=20
line 201, in _send
     (Object: MailHost)
   File /opt/Python-2.1.3/lib/python2.1/smtplib.py, line 479, in sendmail
   File /opt/Python-2.1.3/lib/python2.1/smtplib.py, line 361, in mail
   File /opt/Python-2.1.3/lib/python2.1/smtplib.py, line 122, in quoteaddr
   File /opt/Python-2.1.3/lib/python2.1/rfc822.py, line 475, in parseaddr
   File /opt/Python-2.1.3/lib/python2.1/rfc822.py, line 520, in getaddrlist
   File /opt/Python-2.1.3/lib/python2.1/rfc822.py, line 528, in getaddress
   File /opt/Python-2.1.3/lib/python2.1/rfc822.py, line 508, in gotonext
TypeError: (see above)



















--=====================_201096859==_.ALT
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<b>I try to send a mail to a user from a form.<br>
When I type my mail in the dtml-code, there is no problem but when I
intend to use &lt;dtml-var name=3D&quot;mail&quot;&gt;, <br><br>
Zope generate this error :<br>
Error Type: TypeError<br>
<table border=3D0>
<tr><th width=3D561>Error Value: len() of unsized object</b></th></tr>
</table>
<font face=3D"Courier New, Courier"><br>
I have try to use smtphost tag instead of mailhost but the error
generated is the same.<br>
Is it a problem of proxy,port number, or user's permissions which
could'nt send mail, or only a syntax error??<br><br>
If somebody know the answer...<br>
Thanks in advance,<br>
William<br><br>
Here is the code I wrote :<br>
Form (DTML document)<br>
&lt;form action=3D&quot;sendMailUser&quot;&gt;<br>
&nbsp; L'image que vous avez soumise, ainsi que son contenu, vont
maintenant =EAtre contr=F4l=E9s par nos managers.&lt;br&gt;<br>
&nbsp; Saisissez votre e-mail si vous d=E9sirez =EAtre tenu au courant de
l'=E9tape de mise en ligne.&lt;br&gt;<br>
&nbsp;Name : &lt;input name=3Dname size=3D40&gt;<br>
&nbsp;Email : &lt;input name=3Dmail size=3D40&gt;<br>
&nbsp;&lt;input type=3D&quot;submit&quot;
value=3D&quot;Valider&quot;&gt;<br>
&lt;/form&gt;<br><br>
sendMailUser(DTML method)<br>
&lt;dtml-sendmail mailhost=3D&quot;MailHost&quot;&gt;<br>
&nbsp;To: &quot;wgarcia@esrf.fr&quot;<br>
&nbsp;From: &lt;dtml-var name=3D&quot;mail&quot;&gt;<br>
&nbsp;Subject: ESRF : Image<br>
&nbsp;Name: &lt;dtml-var name=3D&quot;name&quot;&gt;<br>
&nbsp;Email:&lt;dtml-var name=3D&quot;mail&quot;&gt;<br>
&nbsp;Order:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Soumission en cours<br>
&lt;/dtml-sendmail&gt;<br><br>
Traceback (innermost last):<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line
150, in publish_module<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line
114, in publish<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Zope/__init__.py, line 159,
in zpublisher_exception_hook<br>
&nbsp;&nbsp;&nbsp; (Object: recherche_indexation)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line
98, in publish<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/mapply.py, line
88, in mapply<br>
&nbsp;&nbsp;&nbsp; (Object: sendMailUser)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line
39, in call_object<br>
&nbsp;&nbsp;&nbsp; (Object: sendMailUser)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py, line
127, in __call__<br>
&nbsp;&nbsp;&nbsp; (Object: sendMailUser)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_String.py,
line 473, in __call__<br>
&nbsp;&nbsp;&nbsp; (Object: sendMailUser)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Products/MailHost/SendMailTag.=
py,
line 116, in render<br>
&nbsp;&nbsp;&nbsp; (Object: MailHost)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Products/MailHost/MailHost.py,
line 156, in send<br>
&nbsp;&nbsp;&nbsp; (Object: MailHost)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Products/MailHost/MailHost.py,
line 201, in _send<br>
&nbsp;&nbsp;&nbsp; (Object: MailHost)<br>
&nbsp; File /opt/Python-2.1.3/lib/python2.1/smtplib.py, line 479, in
sendmail<br>
&nbsp; File /opt/Python-2.1.3/lib/python2.1/smtplib.py, line 361, in
mail<br>
&nbsp; File /opt/Python-2.1.3/lib/python2.1/smtplib.py, line 122, in
quoteaddr<br>
&nbsp; File /opt/Python-2.1.3/lib/python2.1/rfc822.py, line 475, in
parseaddr<br>
&nbsp; File /opt/Python-2.1.3/lib/python2.1/rfc822.py, line 520, in
getaddrlist<br>
&nbsp; File /opt/Python-2.1.3/lib/python2.1/rfc822.py, line 528, in
getaddress<br>
&nbsp; File /opt/Python-2.1.3/lib/python2.1/rfc822.py, line 508, in
gotonext<br>
TypeError: (see above)<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
</font><br>
</html>

--=====================_201096859==_.ALT--