By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,504 Members | 1,190 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,504 IT Pros & Developers. It's quick & easy.

Emailing in Python

P: n/a
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 = 'p*******@hotmail.com'
# you == the recipient's email address

email_list= 'p*******@uottawa.ca, ph******@hotmail.com'

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()
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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 = 'p*******@hotmail.com'
# you == the recipient's email address

email_list= 'p*******@uottawa.ca, ph******@hotmail.com'

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()

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.