'''
Created on 21-Aug-2014
@author: bambo
'''
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
import smtplib
'''
prepare Header Of Message - Start
'''
fromAddr = "bambobabu@gmail.com"
toAddr = "bambobabu@gmail.com"
msg = MIMEMultipart()
msg['From'] = fromAddr
msg['To'] = toAddr
msg['Subject'] ="Python EMail"
body = "<h1>Python Body</h1>"
msg.attach(MIMEText(body,'html'))
'''
prepare Header Of Message - End
'''
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.ehlo()
server.login("bambobabu@gmail.com", "Mca_503911")
text = msg.as_string()
print text
server.sendmail(fromAddr, toAddr, text)
Created on 21-Aug-2014
@author: bambo
'''
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
import smtplib
'''
prepare Header Of Message - Start
'''
fromAddr = "bambobabu@gmail.com"
toAddr = "bambobabu@gmail.com"
msg = MIMEMultipart()
msg['From'] = fromAddr
msg['To'] = toAddr
msg['Subject'] ="Python EMail"
body = "<h1>Python Body</h1>"
msg.attach(MIMEText(body,'html'))
'''
prepare Header Of Message - End
'''
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.ehlo()
server.login("bambobabu@gmail.com", "Mca_503911")
text = msg.as_string()
print text
server.sendmail(fromAddr, toAddr, text)
No comments:
Post a Comment