Skip to content

Instantly share code, notes, and snippets.

Created Sep 5, 2020
What would you like to do?
import yagmail
import sys
#initializing the server connection
yag = yagmail.SMTP(user='sender@sender', password='xxx')
#sending the email
yag.send(to='to@to', subject='Motion detected', contents=['Motion', sys.argv[1]])
print("Email sent successfully")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment