Skip to content

Instantly share code, notes, and snippets.

@ulrischa
Created September 5, 2020 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ulrischa/3f00d209761b755d1c01df7a546efdd2 to your computer and use it in GitHub Desktop.
Save ulrischa/3f00d209761b755d1c01df7a546efdd2 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
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