Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import smtplib
- import base64
- from email.mime.image import MIMEImage
- from email.mime.multipart import MIMEMultipart
- gmail_user = "covai.embedded@gmail.com"
- gmail_pwd = "*******"
- FROM = 'covai.embedded@gmail.com'
- TO = ['aaaaaaaaaaaa@gmail.com']
- msg = MIMEMultipart()
- time.sleep(1)
- msg['Subject'] ='PANTECH Testing Message'
- time.sleep(1)
- try:
- server = smtplib.SMTP("smtp.gmail.com", 587)
- print "smtp.gmail"
- server.ehlo()
- print "ehlo"
- server.starttls()
- print "starttls"
- server.login(gmail_user, gmail_pwd)
- print "reading mail & password"
- server.sendmail(FROM, TO, msg.as_string())
- print "from"
- server.close()
- print 'successfully sent the mail'
- except:
- print "failed to send mail"
Add Comment
Please, Sign In to add comment