Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. python3 -m smtpd -c DebuggingServer -n localhost:1025
  2.  
  3. import smtplib, ssl
  4.  
  5. port = 465 # For SSL
  6. smtp_server = "smtp.gmail.com"
  7. sender_email = "mobilesampleacc@gmail.com" # Enter your address
  8. receiver_email = "mahimajay99@gmail.com" # Enter receiver address
  9. password = "mobilesampleacc123"
  10. message = """\
  11. Subject: Drunk Contact Alert
  12.  
  13. Hello there,
  14.  
  15. This is an automated message. John Doe has had more than the permissible limit of alcohol and he is trying to drive. Please contact him at the earliest.
  16.  
  17. Best Regards,
  18. Alcoloc
  19.  
  20. """
  21. context = ssl.create_default_context()
  22. with smtplib.SMTP_SSL(smtp_server, port, context=context) as server:
  23. server.login(sender_email, password)
  24. server.sendmail(sender_email, receiver_email, message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement