From 105b65bcbac29e10780d0d2431a999b3d4f81d81 Mon Sep 17 00:00:00 2001 From: Tanishk04 Date: Sat, 21 Oct 2023 23:32:31 +0530 Subject: [PATCH 1/2] added Send Bulk email scirpt --- Send Bulk Email/main.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Send Bulk Email/main.py diff --git a/Send Bulk Email/main.py b/Send Bulk Email/main.py new file mode 100644 index 00000000..75395f28 --- /dev/null +++ b/Send Bulk Email/main.py @@ -0,0 +1,32 @@ +# Import smtplib for our actual email sending function +import smtplib + +# Helper email modules +from email.mime.text import MIMEText +from email.mime.multipart import MIMEMultipart +from email.mime.base import MIMEBase +from email import encoders + + +# sender email address +email_user = 'SENDER_EMAIL' + +# sender email passowrd for login purposes +email_password = 'SENDER_EMAIL_PASSWORD' + +# list of users to whom email is to be sent +email_send = ['LIST_OF_RECIPIENTS'] +subject = 'EMAIL_SUBJECT' +msg = MIMEMultipart() +msg['From'] = email_user +# converting list of recipients into comma separated string +msg['To'] = ", ".join(email_send) +msg['Subject'] = subject +body = 'EMAIL_BODY' +msg.attach(MIMEText(body,'plain')) +text = msg.as_string() +server = smtplib.SMTP('smtp.gmail.com',587) +server.starttls() +server.login(email_user,email_password) +server.sendmail(email_user,email_send,text) +server.quit() \ No newline at end of file From dcf8baf81a808e4410589ea766f9486dd075d060 Mon Sep 17 00:00:00 2001 From: Tanishk04 Date: Sun, 30 Jun 2024 21:17:09 +0530 Subject: [PATCH 2/2] updated Readme doc --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3205dbc4..b4853308 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ More information on contributing and the general code of conduct for discussion | Random Color Generator | [Random Color Generator](https://github.com/DhanushNehru/Python-Scripts/tree/master/Random%20Color%20Generator) | A random color generator that will show you the color and values! | | Run Then Notify | [Run Then Notify](https://github.com/DhanushNehru/Python-Scripts/tree/master/Run%20Then%20Notify) | Runs a slow command and mails you when it completes execution. | | Selfie with Python | [Selfie_with_Python](https://github.com/DhanushNehru/Python-Scripts/tree/master/Selfie%20with%20Python) | Take your selfie with python . | +| Send Bulk Email | [Send Bulk Email](https://github.com/DhanushNehru/Python-Scripts/tree/master/Send%20Bulk%20Email) | Send Bulk Email with python. | | Simple TCP Chat Server | [Simple TCP Chat Server](https://github.com/DhanushNehru/Python-Scripts/tree/master/TCP%20Chat%20Server) | Creates a local server on your LAN for receiving and sending messages! | | Snake Water Gun | [Snake Water Gun](https://github.com/DhanushNehru/Python-Scripts/tree/master/Snake%20Water%20Gun) | A game similar to Rock Paper Scissors. | | Sorting | [Sorting](https://github.com/DhanushNehru/Python-Scripts/tree/master/Sorting) | Algorithm for bubble sorting. |