Server.sendmail with no "to_addrs" parameter.

Tim Williams (gmail) tdwdotnet at
Wed Mar 22 19:29:25 CET 2006

On 22 Mar 2006 08:31:16 -0800, EdWhyatt <ed.whyatt at> wrote:
> So it's a restriction of Python?
> What I am trying to simulate here is the sending of mail to addresses
> solely in the CC and/or BCC fields - both of which are possible through
> Outlook.
> --

Python will quite happily do this too.

The RFC issue is a red herring,  in practice there are very few SMTP servers
that will refuse an email that is missing 1 or more of the required
headers.  Whether the email passes spam filters is a different matter.

For fun,  try this. (add your own gmail address, or other address and mail

>>> import smtplib
>>> server = smtplib.SMTP('')
>>> server.sendmail('','addr removed at','hello') #  '' = 2x '  not
1x "

and this is the email that appeared in my gmail account almost instantly.
:):)   It was sent with no SMTP-FROM address,  and has no subject field and
no address fields.

X-Gmail-Received: a567a9150c14fda1ff4d6807593843ef2ffde3ac
Delivered-To: addr removed at
Received: by with SMTP id w7cs2971nfk;
        Wed, 22 Mar 2006 10:19:04 -0800 (PST)
Received: by with SMTP id x61mr1847789nzh;
        Wed, 22 Mar 2006 10:19:03 -0800 (PST)
Return-Path: <None>
Received: from TW-JVC.tdw (
        by with ESMTP id 34si1261330nza.2006.;
        Wed, 22 Mar 2006 10:19:03 -0800 (PST)
Received-SPF: neutral ( is neither permitted
nor denied by best guess record for domain of None)
Date: Wed, 22 Mar 2006 10:19:03 -0800 (PST)
Message-Id: <44219517.7a5d6a13.61b1.3c2fSMTPIN_ADDED at>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list