multiple email recipients

Discussion in 'Python' started by eight02645999@yahoo.com, Feb 20, 2006.

  1. Guest

    hi
    i currently am using this email function that can send single email
    address
    def email(HOST,FROM,TO,SUBJECT,BODY,CC=None):
    import smtplib
    import string, sys
    body = string.join((
    "From: %s" % FROM,
    "To: %s" % TO,
    "Subject: %s" % SUBJECT,
    "CC: %s" % CC,
    "",
    BODY), "\r\n")

    server = smtplib.SMTP(HOST)
    server.sendmail(FROM, [TO,CC],body)
    server.quit()

    was wondering how to modify the code so as i can send to multiple email
    recipients using "TO"? thanks.
     
    , Feb 20, 2006
    #1
    1. Advertising

  2. Rene Pijlman Guest

    :
    >was wondering how to modify the code so as i can send to multiple email
    >recipients using "TO"? thanks.


    You add RFC 2822 headers.
    http://www.ietf.org/rfc/rfc2822.txt
    ("3.6.3. Destination address fields")

    --
    René Pijlman
     
    Rene Pijlman, Feb 20, 2006
    #2
    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. .Net Newbie

    Single email to multiple recipients

    .Net Newbie, Jun 30, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    9,421
    .Net Newbie
    Jul 1, 2004
  2. Alex Hunsley
    Replies:
    2
    Views:
    872
    Paul Wright
    Jul 1, 2004
  3. dmiller23462

    Multiple Email Recipients depending on Value

    dmiller23462, Oct 28, 2004, in forum: ASP General
    Replies:
    4
    Views:
    253
    dmiller23462
    Nov 16, 2004
  4. Logesh Subramani

    Sending email to multiple recipients

    Logesh Subramani, Aug 5, 2008, in forum: Ruby
    Replies:
    1
    Views:
    150
    James Britt
    Aug 5, 2008
  5. Joseph Clark
    Replies:
    2
    Views:
    241
    Dave Lilley
    Oct 14, 2010
Loading...

Share This Page