Skip to content

Instantly share code, notes, and snippets.

@ilovetogetspamed
Created October 27, 2016 20:36
Show Gist options
  • Save ilovetogetspamed/098dfe68822a56d2edde00508babe68b to your computer and use it in GitHub Desktop.
Save ilovetogetspamed/098dfe68822a56d2edde00508babe68b to your computer and use it in GitHub Desktop.
Sendmail via SMTP using Python smtplib
import smtplib
fromaddr = 'anye...@gmail.com'
toaddrs = 'myfr...@gmail.com'
msg = 'some one is using this app'
username = 'anyem...@gmail.com'
password = 'password'
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment