Send email notification

Discussion in 'Python' started by Ernesto, Mar 7, 2006.

  1. Ernesto

    Ernesto Guest

    Is there a special module for mail ?

    I'd like to send an email [to 'n' unique email addresses] from a python
    script.

    Thanks !
     
    Ernesto, Mar 7, 2006
    #1
    1. Advertising

  2. Laszlo Zsolt Nagy, Mar 7, 2006
    #2
    1. Advertising

  3. Ernesto

    Ernesto Guest

    I guess that was jerk-off version of:

    "smtplib"

    Thanks a lot.
     
    Ernesto, Mar 7, 2006
    #3
  4. Ernesto

    Larry Bates Guest

    Ernesto wrote:
    > Is there a special module for mail ?
    >
    > I'd like to send an email [to 'n' unique email addresses] from a python
    > script.
    >
    > Thanks !
    >

    This class makes what you want to do extremely easy.

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

    -Larry Bates
     
    Larry Bates, Mar 7, 2006
    #4
  5. Ernesto

    rtilley Guest

    Ernesto wrote:
    > Is there a special module for mail ?
    >
    > I'd like to send an email [to 'n' unique email addresses] from a python
    > script.


    from email.MIMEText import MIMEText
    import email.Utils
    import smtplib

    # 'users' is a list of email addys.
    for u in users:
    try:
    print "Sending email to ... ", u
    f = "FROM_NAME<FROM_EMAIL_ADDY@YOUR_DOMAIN.com>"
    t = u

    msg = MIMEText("""MESSAGE BODY OF EMAIL""")

    msg["Subject"] = "MESSAGE SUBJECT"
    msg["Message-id"] = email.Utils.make_msgid()
    msg["From"] = f
    msg["To"] = t

    h = "YOUR.SMTP.SERVER"
    s = smtplib.SMTP(h)
    s.sendmail(f, t, msg.as_string())
    s.quit()
    except Exception, e:
    print e
     
    rtilley, Mar 7, 2006
    #5
  6. Ernesto

    Steve Holden Guest

    Ernesto wrote:
    > I guess that was jerk-off version of:
    >
    > "smtplib"
    >
    > Thanks a lot.
    >

    Well, it gave you the information you wanted, right? (Except that it
    might have mentioned the "email" package, which would help you
    formulating the messages as well.

    But that which doesn't kill us makes us stronger, and at least you
    aren't dead :)

    Hang around here long and you'll see a bunch of people waiting on
    replies to questions Google could have given them far quicker. If we
    weren't paid thousands of dollars a week to answer questions on this
    list we'd probably get snarky more often.

    regards
    Steve
    --
    Steve Holden +44 150 684 7255 +1 800 494 3119
    Holden Web LLC/Ltd www.holdenweb.com
    Love me, love my blog holdenweb.blogspot.com
     
    Steve Holden, Mar 8, 2006
    #6
  7. On Wed, 08 Mar 2006 06:20:42 +0000, Steve Holden <>
    declaimed the following in comp.lang.python:

    > Hang around here long and you'll see a bunch of people waiting on
    > replies to questions Google could have given them far quicker. If we
    > weren't paid thousands of dollars a week to answer questions on this
    > list we'd probably get snarky more often.
    >

    What! Why didn't anyone tell me where to submit my timecard?
    --
    > ============================================================== <
    > | Wulfraed Dennis Lee Bieber KD6MOG <
    > | Bestiaria Support Staff <
    > ============================================================== <
    > Home Page: <http://www.dm.net/~wulfraed/> <
    > Overflow Page: <http://wlfraed.home.netcom.com/> <
     
    Dennis Lee Bieber, Mar 8, 2006
    #7
  8. Ernesto a écrit :
    > Is there a special module for mail ?
    >
    > I'd like to send an email [to 'n' unique email addresses] from a python
    > script.


    If you want all adressee to be the only one visible in to: field, you
    must send n emails.

    For such a purpose, see iMailer module here:

    http://nojhan.free.fr/article.php3?id_article=22

    Else, see other posts.

    A+

    Laurent.
     
    Laurent Pointal, Mar 8, 2006
    #8
  9. On 2006-03-08, Steve Holden <> wrote:

    > Hang around here long and you'll see a bunch of people waiting
    > on replies to questions Google could have given them far
    > quicker. If we weren't paid thousands of dollars a week to
    > answer questions on this list we'd probably get snarky more
    > often.


    That reminds me: I haven't seen last weeks check yet. I trust
    it will arrive soon...

    --
    Grant Edwards grante Yow! I feel like I am
    at sharing a "CORN-DOG" with
    visi.com NIKITA KHRUSCHEV...
     
    Grant Edwards, Mar 8, 2006
    #9
  10. On Wed, 08 Mar 2006 06:20:42 +0000, rumours say that Steve Holden
    <> might have written:

    > If we
    >weren't paid thousands of dollars a week to answer questions on this
    >list we'd probably get snarky more often.


    Steve, please, don't make me look like a liar in front of the children!
    --
    TZOTZIOY, I speak England very best.
    "Dear Paul,
    please stop spamming us."
    The Corinthians
     
    Christos Georgiou, Mar 8, 2006
    #10
  11. Ernesto

    Peter Hansen Guest

    Dennis Lee Bieber wrote:
    > On Wed, 08 Mar 2006 06:20:42 +0000, Steve Holden <>
    > declaimed the following in comp.lang.python:
    >
    >>Hang around here long and you'll see a bunch of people waiting on
    >>replies to questions Google could have given them far quicker. If we
    >>weren't paid thousands of dollars a week to answer questions on this
    >>list we'd probably get snarky more often.

    >
    > What! Why didn't anyone tell me where to submit my timecard?


    It's by the *byte*, Dennis. How did you think Alex managed all that
    time off real work to write a book on Python (like anyone buys those)?

    ;-)

    -Peter
     
    Peter Hansen, Mar 9, 2006
    #11
    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. Peter
    Replies:
    0
    Views:
    3,400
    Peter
    Jul 1, 2003
  2. Replies:
    2
    Views:
    432
    Tintin
    Jan 5, 2007
  3. Replies:
    13
    Views:
    526
    Randy Webb
    May 14, 2006
  4. pbd22
    Replies:
    1
    Views:
    169
  5. ashish makani
    Replies:
    5
    Views:
    646
    Mark Lawrence
    Sep 20, 2012
Loading...

Share This Page