[Zope] "To: undisclosed recipient;:" when sending mail through a script !!!

Tino Wildenhain tino@wildenhain.de
Tue, 07 May 2002 05:16:45 +0200


Hi Gilles,

--On Montag, 13. Mai 2002 15:22 +0200 Gilles Lenfant <gilles@objectis.net> 
wrote:

> Hi,
>
> My app sends mail through a python script like this...
>
> body = "blah blah body"
> title = "blah blah title"
> mh = container.mailhost_list()[0]
> mh.send(body, mto='me@somedomain.com',
>   mfrom='mailmaster@somedomain.com',
>   subject=title, encoding='quoted-printable')
> return 'OK'
>
> This works but the mail has not the excepted "to" header and shows...
>
> "To: undisclosed-recipients: ;"
>
> This is pretty unfair in the mail client.
>
> Did I miss something to have the "mto" parameter of the .send() method in
> the "To:" header of the mail ?

The mto parameter is only for the envelope. If you want to have some extra 
headers
in the mail, you should add them at beginning at the very first line in 
your mail.
Dont forget the empty line before you start with the body.
Extra headers can be (but are not limited to):
to:
from:
sender:
reply-to:
precedence:
...

see http://www.faqs.org/ for rfc822

HTH
Tino Wildenhain


> Thanks in advance
>
> --Gilles
>
>
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )