smtplib question

G

Garry Hodgson

how do i use smtplib to send mail to someone with "cc" to someone else?
if i just include the "to" addressees in the call to smtplib.sendmail(), and
put the others in the "Cc" header fields, only the "To" recipients get the mail,
thought the mail headers look right.

but if i also add the "Cc" folks to the list of recipients in the call to smtplib.sendmail(),
it arrives at their mailer with their address listed on both the "To" and "Cc"
header fields.

what i want is for everyone on the "To" or "Cc" list to get the mail, and for
the mail headers to reflect this.

please respond off-list. i had to give up following comp.lang.python for lack
of time.

thanks
 
G

Garry Hodgson

Garry said:
how do i use smtplib to send mail to someone with "cc" to someone else?
if i just include the "to" addressees in the call to smtplib.sendmail(), and
put the others in the "Cc" header fields, only the "To" recipients get the mail,
thought the mail headers look right.

oops. please ignore this. it was just a dumb mistake on my part.

--
Garry Hodgson Those who would give up essential
liberty
Senior Hacker to purchase a little temporary safety
Software Innovation Services deserve neither liberty nor safety.
AT&T Labs
(e-mail address removed) - Benjamin Franklin, 1775
 
T

Tim Roberts

Garry Hodgson said:
how do i use smtplib to send mail to someone with "cc" to someone else?
if i just include the "to" addressees in the call to smtplib.sendmail(), and
put the others in the "Cc" header fields, only the "To" recipients get the mail,
thought the mail headers look right.

The e-mail headers (To:, Cc:, Subject:, etc.) are not part of SMTP. They
are ignored by sendmail and play no part at all in the e-mail delivery.
The only thing sendmail cares about is the list of addresses in the SMTP
protocol, which comes from the first parameter to smtplib.sendmail.

So, the short answer is that the address list (first parameter to
smtplib.sendmail) must include EVERYONE that should receive the message --
To, Cc, or Bcc -- in one big list. You can put whatever you want in the
headers in the body of the message; it won't matter. For large lists, it
is common for the header to say, for example:

To: recipient list suppressed

Perfectly legal.
please respond off-list. i had to give up following comp.lang.python for lack
of time.

But yet, you expect us to take OUR time to answer your questions for free?
That doesn't seem right.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,083
Latest member
SylviaHarr

Latest Threads

Top