Skip to content

Instantly share code, notes, and snippets.

@uoxiu
Created February 15, 2017 09:20
Show Gist options
  • Save uoxiu/9575c502271cbbc203a53a32d510df72 to your computer and use it in GitHub Desktop.
Save uoxiu/9575c502271cbbc203a53a32d510df72 to your computer and use it in GitHub Desktop.
from smtplib import SMTP_SSL
from email.mime.text import MIMEText
send_to = '[email protected]'
# nu uita de active https://www.google.com/settings/security/lesssecureapps
smtp_user = '[email protected]'
smtp_pass = 'myfkpassword'
smtp_conn = SMTP_SSL('smtp.gmail.com', 465)
smtp_conn.set_debuglevel(True)
smtp_conn.login(smtp_user, smtp_pass)
msg = MIMEText('Content of message')
msg['Subject']= 'Subject of email'
msg['From'] = smtp_user
smtp_conn.sendmail(smtp_user, send_to, msg.as_string())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment