Server.sendmail with no "to_addrs" parameter.

Jeffrey Froman jeffrey at fro.man
Wed Mar 22 12:15:16 EST 2006


EdWhyatt wrote:

> I would like to have the ability to send a mail
> message with no-one email address in the To field.

The to_addrs parameter is for the SMTP "RCPT TO", which must contain at
least one address. It has nothing to do with the To: header of the email.

You can *also* add the recipient addresses to either of the Cc: or To:
header fields as necessary, or leave them out of any header (the equivalent
of adding the addresses to the Bcc: field.)

As Arne Ludwig pointed it, it may not be RFC compliant to leave an entirely
blank To: header, but in either case, the To: header need not contain any
of the addresses specified in the to_addrs list.


Jeffrey



More information about the Python-list mailing list