-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
34 lines (27 loc) · 993 Bytes
/
app.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
30
31
32
33
34
def main():
import smtplib
import Verify
import os
MyEmailPassword = os.environ['ReminderEmailPassword']
MyEmail = os.environ['ReminderEmail']
from email.message import EmailMessage
EmailTitle = input("What do you want the title of the email to be?\n|> ")
EmailBody = input("What do you want the email body to be?\n|> ")
EmailRecipient = input("Who do you want to send the email to?\n|> ")
Email_Address = MyEmail
EMAIL_PASSWORD = MyEmailPassword
msg = EmailMessage()
msg['Subject'] = EmailTitle
msg['From'] = Email_Address
msg['To'] = EmailRecipient
msg.set_content(EmailBody)
EmailValid = Verify.ValidateEmail(EmailRecipient)
if EmailValid == True:
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as smtp:
smtp.login(Email_Address, EMAIL_PASSWORD)
smtp.send_message(msg)
print("Email Sent")
else:
print("Email Not Sent")
if __name__ == "__main__":
main()