Skip to content

Instantly share code, notes, and snippets.

@makersm
Created May 27, 2016 17:59
Show Gist options
  • Save makersm/76e5c90bc7be16b3584faf7c9768606a to your computer and use it in GitHub Desktop.
Save makersm/76e5c90bc7be16b3584faf7c9768606a to your computer and use it in GitHub Desktop.
send email using python
import smtplib
from email.mime.text import MIMEText
sender = 'sender@example.com' #my domain
recipient = 'recipient@example.com'
mail = MIMEText('message goes here')
mail['Subject'] = 'title goes here'
mailserver = smtplib.SMTP('localhost')
mailserver.sendmail(sender, recipient, mail.as_string())
mailserver.quit()
@makerj
Copy link

makerj commented May 27, 2016

Good job kid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment