Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- python3 -m smtpd -c DebuggingServer -n localhost:1025
- import smtplib, ssl
- port = 465 # For SSL
- smtp_server = "smtp.gmail.com"
- sender_email = "mobilesampleacc@gmail.com" # Enter your address
- receiver_email = "mahimajay99@gmail.com" # Enter receiver address
- password = "mobilesampleacc123"
- message = """\
- Subject: Drunk Contact Alert
- Hello there,
- 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.
- Best Regards,
- Alcoloc
- """
- context = ssl.create_default_context()
- with smtplib.SMTP_SSL(smtp_server, port, context=context) as server:
- server.login(sender_email, password)
- server.sendmail(sender_email, receiver_email, message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement