Send email to two receivers : Email « Network « Python






Send email to two receivers

 

import smtplib
import string

host = "localhost"
fromclause = "a@b.com"
toclause = "c@d.com, e@f.com"

toclause = string.splitfields(toclause, ",")
msgbody = """
Test!
Best Regards
"""
SMTPServer = smtplib.SMTP(host)
SMTPServer.sendmail(fromclause, toclause, msgbody)
SMTPServer.quit()

   
  








Related examples in the same category

1.Print out email message from your email box
2.Get email message mymailbox.msg file
3.Sending Some E-Mail
4.MIME Multipart Messages
5.Send an email
6.Login to POP3 server and retrieve information
7.Sending Mail over an SMTP Connection