From 3577c695aded75c9917097ec53f77e2c9ea3ce9f Mon Sep 17 00:00:00 2001 From: Mohib Bhojani Date: Sat, 25 Oct 2025 10:20:43 +0500 Subject: [PATCH 1/2] Create send_email.py --- send_email.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 send_email.py diff --git a/send_email.py b/send_email.py new file mode 100644 index 000000000000..6630b4fac53e --- /dev/null +++ b/send_email.py @@ -0,0 +1,28 @@ +import smtplib +import ssl +from email.mime.multipart import MIMEMultipart +from email.mime.text import MIMEText + +try: + email = "<< Enter your email >>" + password = "<< Enter your password" + to = "<< Enter sender email >>" + msg = """ << Email Body >>""" + message = MIMEMultipart() + message["From"] = email + message["To"] = to + message["Subject"] = "HacktoberFest 2019" + message.attach(MIMEText(msg, "plain")) + context = ssl.create_default_context() + server = smtplib.SMTP("smtp.gmail.com") + server.starttls() + server.ehlo() + server.login(email, password) + server.sendmail(email, to, message.as_string()) + print('Email have been successfully send') + +except Exception as ex: + print(ex) + +finally: + server.quit() From fb8013d113867c3538e45b7f07f6bcdc74246003 Mon Sep 17 00:00:00 2001 From: MohibBhojani Date: Sat, 25 Oct 2025 05:21:07 +0000 Subject: [PATCH 2/2] updating DIRECTORY.md --- DIRECTORY.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DIRECTORY.md b/DIRECTORY.md index 0f9859577493..2f2330979e27 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -1260,6 +1260,8 @@ * [Tabu Search](searches/tabu_search.py) * [Ternary Search](searches/ternary_search.py) +## [Send Email](/send_email.py) + ## Sorts * [Bead Sort](sorts/bead_sort.py) * [Binary Insertion Sort](sorts/binary_insertion_sort.py)