Emailing in Python

Discussion in 'Python' started by Philippe Reynolds, Dec 14, 2004.

  1. Hi,

    I'm learning python...one of my tasks is to send out emails...
    I can send emails to one person at a time but not as groups....

    Do you think you can help.

    Cheers
    Philippe Reynolds

    Here is the section of code:
    # me == the sender's email address
    me = ''
    # you == the recipient's email address

    email_list= ', '

    msg['Subject'] = 'EVENT REPORT'
    msg['From'] = me
    msg['To'] = email_list

    # Send the message via our own SMTP server, but don't include the
    # envelope header.
    s = smtplib.SMTP()
    s.connect()
    s.sendmail(me, [email_list], msg.as_string())
    s.close()
     
    Philippe Reynolds, Dec 14, 2004
    #1
    1. Advertising

  2. Philippe Reynolds

    Larry Bates Guest

    Great class for making this very easy located here:

    http://motion.sourceforge.net/related/send_jpg.py

    And is supports list of binary attachments that is
    pretty tricky by hand.

    Larry Bates
    Syscon, Inc.



    Philippe Reynolds wrote:
    > Hi,
    >
    > I'm learning python...one of my tasks is to send out emails...
    > I can send emails to one person at a time but not as groups....
    >
    > Do you think you can help.
    >
    > Cheers
    > Philippe Reynolds
    >
    > Here is the section of code:
    > # me == the sender's email address
    > me = ''
    > # you == the recipient's email address
    >
    > email_list= ', '
    >
    > msg['Subject'] = 'EVENT REPORT'
    > msg['From'] = me
    > msg['To'] = email_list
    >
    > # Send the message via our own SMTP server, but don't include the
    > # envelope header.
    > s = smtplib.SMTP()
    > s.connect()
    > s.sendmail(me, [email_list], msg.as_string())
    > s.close()
    >
    >
     
    Larry Bates, Dec 14, 2004
    #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. Stephen

    emailing passwords using .NET

    Stephen, Jul 20, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    387
    R.Balaji
    Jul 23, 2004
  2. tafs7
    Replies:
    3
    Views:
    4,013
    Alvin Bruney
    Dec 22, 2003
  3. Farooq Khan

    emailing in ASP.NET

    Farooq Khan, Dec 29, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    848
    Farooq Khan
    Dec 30, 2003
  4. Mark Rodseth

    .NET emailing problem

    Mark Rodseth, Apr 21, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    396
  5. Brian

    Emailing Errors from Pages

    Brian, May 12, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    568
Loading...

Share This Page