"Michael P. Reilly" <arcege@shore.net> writes:
> Philip C. <pjc_2@geocities.com> wrote:
> : I have pretty much figured out how to use the module but I can't seem
> : set the subject or the from of the bcc etc....
[snip]
> The protocol for SMTP requires that the headers are included.
Actually, Bcc: shouldn't be, even if some mail servers seem to work as
you expect. If you want to Bcc: to someone, add their address to the
envelope recipients, but not the message:
>>> fromaddr = 'c.evans@clear.net.nz'
>>> toaddr = 'eggs@example.com'
>>> msg = '''From: Carey Evans <c.evans@clear.net.nz>
To: Spam, spam, spam, eggs and spam <eggs@example.com>
Subject: Something completely different
Blah, blah, blah...'''
>>> s = smtplib.SMTP('localhost')
>>> s.sendmail(fromaddr, [fromaddr, toaddr], msg)
--
Carey Evans
http://home.clear.net.nz/pages/c.evans/ "I'm not a god. I've just been misquoted."