Server.sendmail with no "to_addrs" parameter.

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


On 22 Mar 2006 08:31:16 -0800, EdWhyatt <ed.whyatt at gmail.com> 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.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

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
server)

>>> import smtplib
>>> server = smtplib.SMTP('gsmtp163.google.com')
>>> server.sendmail('','addr removed at gmail.com','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 gmail.com
Received: by 10.49.69.7 with SMTP id w7cs2971nfk;
        Wed, 22 Mar 2006 10:19:04 -0800 (PST)
Received: by 10.36.250.61 with SMTP id x61mr1847789nzh;
        Wed, 22 Mar 2006 10:19:03 -0800 (PST)
Return-Path: <None>
Received: from TW-JVC.tdw (cpc1-rdng1-0-0-cust636.winn.cable.ntl.com
[82.21.66.125])
        by mx.gmail.com with ESMTP id 34si1261330nza.2006.03.22.10.19.03;
        Wed, 22 Mar 2006 10:19:03 -0800 (PST)
Received-SPF: neutral (gmail.com: 82.21.66.125 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 mx.gmail.com>

hello
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060322/2cbf4468/attachment.html>


More information about the Python-list mailing list