"To: undisclosed recipient;:" when sending mail through a script !!!
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 ? Thanks in advance --Gilles
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 )
Thanks, it works but... Need to put explicitely \r\n between 2 header lines (\n only don't work !): fullmail = ("To: someone@somewhere.com\r\n" "From: joe@bar.com\r\n" "Subject: No news...\r\n\r\n" "...Is good news") mh = container.mailhost_list()[0] mh.send(fullmail, encoding="quoted-printable") return "Done..." ----- Original Message ----- From: "Tino Wildenhain" <tino@wildenhain.de> To: "Gilles Lenfant" <gilles@objectis.net>; <zope@zope.org> Sent: Tuesday, May 07, 2002 5:16 AM Subject: Re: [Zope] "To: undisclosed recipient;:" when sending mail througha script !!! [...]
On Mon, May 13, 2002 at 11:50:22PM +0200, Gilles Lenfant wrote: | Thanks, it works but... | Need to put explicitely \r\n between 2 header lines (\n only don't work !): RFC 2822, section 2.1 : Messages are divided into lines of characters. A line is a series of characters that is delimited with the two characters carriage-return and line-feed; that is, the carriage return (CR) character (ASCII value 13) followed immediately by the line feed (LF) character (ASCII value 10). -D -- In his heart a man plans his course, but the Lord determines his steps. Proverbs 16:9 GnuPG key : http://dman.ddts.net/~dman/public_key.gpg
Gilles Lenfant writes:
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 ? If you put it there, that will be at least a workaround...
Dieter
participants (4)
-
Dieter Maurer -
dman -
Gilles Lenfant -
Tino Wildenhain