smtplib question

Discussion in 'Python' started by Garry Hodgson, Sep 17, 2003.

  1. 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

    ----
    Garry Hodgson, Technology Consultant, AT&T Labs

    Be happy for this moment.
    This moment is your life.
     
    Garry Hodgson, Sep 17, 2003
    #1
    1. Advertising

  2. Re: smtplib question - never mind...

    Garry Hodgson wrote:
    >
    > 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
    - Benjamin Franklin, 1775
     
    Garry Hodgson, Sep 18, 2003
    #2
    1. Advertising

  3. Garry Hodgson

    Tim Roberts Guest

    Garry Hodgson <> wrote:
    >
    >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.
    --
    - Tim Roberts,
    Providenza & Boekelheide, Inc.
     
    Tim Roberts, Sep 19, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bill

    SMTPlib Emailing Attachments

    Bill, Sep 17, 2003, in forum: Python
    Replies:
    9
    Views:
    774
    Rudy Schockaert
    Sep 20, 2003
  2. Chris Dewin
    Replies:
    12
    Views:
    534
    Christos Georgiou
    Sep 26, 2005
  3. question about smtplib

    , Oct 3, 2005, in forum: Python
    Replies:
    7
    Views:
    322
    Tim Roberts
    Oct 6, 2005
  4. Tim Williams

    Re: smtplib question

    Tim Williams, Jan 16, 2007, in forum: Python
    Replies:
    1
    Views:
    823
    jean-michel bain-cornu
    Jan 17, 2007
  5. Evan
    Replies:
    3
    Views:
    478
Loading...

Share This Page