[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 <dtml-var name=3D"mail">, <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>
<form action=3D"sendMailUser"><br>
L'image que vous avez soumise, ainsi que son contenu, vont
maintenant =EAtre contr=F4l=E9s par nos managers.<br><br>
Saisissez votre e-mail si vous d=E9sirez =EAtre tenu au courant de
l'=E9tape de mise en ligne.<br><br>
Name : <input name=3Dname size=3D40><br>
Email : <input name=3Dmail size=3D40><br>
<input type=3D"submit"
value=3D"Valider"><br>
</form><br><br>
sendMailUser(DTML method)<br>
<dtml-sendmail mailhost=3D"MailHost"><br>
To: "wgarcia@esrf.fr"<br>
From: <dtml-var name=3D"mail"><br>
Subject: ESRF : Image<br>
Name: <dtml-var name=3D"name"><br>
Email:<dtml-var name=3D"mail"><br>
Order:<br>
Soumission en cours<br>
</dtml-sendmail><br><br>
Traceback (innermost last):<br>
File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line
150, in publish_module<br>
File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line
114, in publish<br>
File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Zope/__init__.py, line 159,
in zpublisher_exception_hook<br>
(Object: recherche_indexation)<br>
File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line
98, in publish<br>
File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/mapply.py, line
88, in mapply<br>
(Object: sendMailUser)<br>
File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line
39, in call_object<br>
(Object: sendMailUser)<br>
File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py, line
127, in __call__<br>
(Object: sendMailUser)<br>
File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_String.py,
line 473, in __call__<br>
(Object: sendMailUser)<br>
File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Products/MailHost/SendMailTag.=
py,
line 116, in render<br>
(Object: MailHost)<br>
File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Products/MailHost/MailHost.py,
line 156, in send<br>
(Object: MailHost)<br>
File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Products/MailHost/MailHost.py,
line 201, in _send<br>
(Object: MailHost)<br>
File /opt/Python-2.1.3/lib/python2.1/smtplib.py, line 479, in
sendmail<br>
File /opt/Python-2.1.3/lib/python2.1/smtplib.py, line 361, in
mail<br>
File /opt/Python-2.1.3/lib/python2.1/smtplib.py, line 122, in
quoteaddr<br>
File /opt/Python-2.1.3/lib/python2.1/rfc822.py, line 475, in
parseaddr<br>
File /opt/Python-2.1.3/lib/python2.1/rfc822.py, line 520, in
getaddrlist<br>
File /opt/Python-2.1.3/lib/python2.1/rfc822.py, line 528, in
getaddress<br>
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--