smtplib & Bcc
Gerhard Häring
gerhard.haering at opus-gmbh.net
Fri Feb 21 05:17:05 EST 2003
Robin Becker <robin at jessikat.fsnet.co.uk> wrote:
> A colleague and I are wondering if smtplib does anything special about
> the Bcc header, or perhaps the truth how we should use the Bcc header.
>
> I tried some simple experiments with Bcc: and cc: inside the message and
> it seems, when I send these using smtplib, that the cc list gets sent
> to, but the Bcc list receives no copy of the mail. Can some kind soul
> explain how we should use the Bcc header?
With
.sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[])
email will be sent to all people in to_addrs. The headers you put into msg
don't matter for delivery at all.
What you could do is write a wrapper for .sendmail that evaluates the
To/CC/BCC headers in a message text and constructs the appropriate list for
to_addrs.
-- Gerhard
More information about the Python-list
mailing list