Question about smtplib, and mail servers in general.

Peter Hansen peter at engcorp.com
Tue Sep 20 08:59:28 EDT 2005


Daniel Dittmar wrote:
> Chris Dewin wrote:
> 
>> Hi. I've been thinking about using smtplib to run a mailing list from 
>> my website.
>>
>> s = smtplib.SMTP("server")
>> s.sendmail(fromaddress, toaddresess, msg)
>>
>> I know that in this instance, the toaddresses variable can be a variable
>> of type list.
>>
>> Suppose the list contains well over 100 emails. Would that create some
>> sort of drain on the mail server? Would I be better off doing it in some
>> other way?
> 
> Not really an answer to your question, but it's probably considered bad 
> style to publish the email addresses of the recipients via the address 
> list. Use a neutral To-address (best: the mailing list address) and add 
> the recipients via bcc: headers.

Not only not an answer, but also not a valid point in this case.  The 
list of recipients used in the sendmail() call (which become RCPT TO: 
commands in SMTP) do *not* show up in the received emails.  Only those 
items explicitly listed in the headers, such as the To: header, will 
appear.  In fact, you could easily make a Bcc: header which actually 
lists everyone and it would probably not even be stripped by most mail 
programs (though I haven't tried that).  Your confusion is caused by not 
distinguishing between mail client programs and a lower level utility 
such as smtplib, which doesn't even look at the To: addresses in the header.

-Peter



More information about the Python-list mailing list