1234567891011121314151617181920212223242526272829 |
- import smtplib
- import sys
-
- gmail_user = 'jose.reyes46@upr.edu'
- gmail_password = sys.argv[1]
-
- sent_from = gmail_user
- to = "emmanuel.nieves@upr.edu"
- subject = 'Usuario y password para ADA'
- body = 'Hey, what\'s up?\n\n- You'
-
- email_text = """
- From: %s
- To: %s
- Subject: %s
-
- %s
- """ % (sent_from, to, subject, body)
-
- try:
- server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
- server.ehlo()
- server.login(gmail_user, gmail_password)
- server.sendmail(sent_from, to, email_text)
- server.close()
-
- print 'Email sent!'
- except:
- print 'Something went wrong...'
|