Mini Project
Mini Project
import smtplib
gmail_user = '[email protected]'
gmail_password = '8290138851'
sent_from = gmail_user
to = ['[email protected]', '[email protected]']
subject = 'For a concern regarding your health'
body = 'How are you, I came to know that you are suffering with COVID, wish a speedy r
email_text = """\
From: %s
To: %s
Subject: %s
%s
""" % (sent_from, ", ".join(to), subject, body)
try:
smtp_server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
smtp_server.ehlo()
smtp_server.login(gmail_user, gmail_password)
smtp_server.sendmail(sent_from, to, email_text)
smtp_server.close()
print ("Email sent successfully!")
except Exception as ex:
print ("Something went wrong….",ex)
In [ ]: