[Email-SIG] question on "cc" and "bcc"
andrew at logicalprogression.net
Wed Sep 1 11:57:30 CEST 2004
Your confusing two concepts - the concept of creating an email message
and the concept of sending it.
msg['bcc'] will just add a bcc header to your email which defeats the
point of bcc!
You'd need to change the sendmail line to something like:
s.sendmail(me, [you] + cclist, msg.as_string())
On 1 Sep 2004, at 10:51, Mark Pettit wrote:
> Dear Email Pythonistas,
> I am battling to get email sent to persons via "cc" and "bcc". Sadly
> the documentation does not give specific examples on this, but 12.2.13
> does give some small clues.
> Using the examples, I have extended them slightly as follows :
> # snip snip =====================
> msg['Subject'] = 'The contents of %s' % textfile
> msg['From'] = me
> msg['To'] = you
> msg['cc'] = cclist # first mod
> msg['bcc'] = bcclist # second mod
> # Send the message via our own SMTP server, but don't include the
> # envelope header.
> s = smtplib.SMTP()
> s.sendmail(me, [you], msg.as_string())
> # snip snip ====================
> But the intended recipients never get the mail (copy or blind copy).
> Does anyone know why the s.sendmail() repeats the "me" and "you", but
> doesn't do anything with "cc" and "bcc" ?
> Has anyone actually done this successfully before - I'm sure that
> someone has and I've just missed some tiny but crucial point.
> Mark Pettit
> Cape Town
> South Africa
> Mark Pettit
> Email-SIG mailing list
> Email-SIG at python.org
> Your options:
Logical Progression Ltd, 20 Forth Street, Edinburgh EH1 3LH, UK
Tel: +44 (0)131 550 3733 Web: http://www.logicalprogression.net/
More information about the Email-SIG