-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauto_mail_report.py
29 lines (22 loc) · 953 Bytes
/
auto_mail_report.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# This code was written for the purpose of sending loud emails at
#the end of compiling a python code. To generate I followed the
#security settings from the link below. You may need to do the
#same if you run it on another computer or in another email.
#https://realpython.com/python-send-email/
your_email = "[email protected]"
import smtplib, ssl
port = 465 # For SSL
smtp_server = "smtp.gmail.com"
sender_email = "[email protected]" # Enter your address
receiver_email = your_email # Enter receiver address
password = input("write your password")
message = """\
Subject:[COSMOSERVER] Results Ready!
Congratulations your code has finished running!
cosmoserver
Bingo Collaboration
National Institute for Space Research"""
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)