Skip to content

Instantly share code, notes, and snippets.

@zakirangwala
Created September 23, 2020 15:00
Show Gist options
  • Save zakirangwala/31144539bf45a7f237b427b42cdefa7a to your computer and use it in GitHub Desktop.
Save zakirangwala/31144539bf45a7f237b427b42cdefa7a to your computer and use it in GitHub Desktop.
Tutorial code : Send emails
import smtplib
def send_mail(subject, body, reciever):
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.ehlo()
server.login(config.email, config.password)
msg = f"Subject: {subject}\n\n{body}"
server.sendmail(config.email, reciever, msg)
server.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment