Created
August 12, 2020 10:22
-
-
Save r1walz/1898aa9449764478ff4b8c18bb2008e9 to your computer and use it in GitHub Desktop.
General Script to send emails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Rohit Ashiwal | |
#email = rohit.ashiwal265@gmail.com | |
email = rashiwal@studentambassadors.com | |
[sendemail] | |
smtpencryption = tls | |
smtpserverport = 587 | |
smtppass = **your password** | |
#smtpserver = smtp.gmail.com | |
#smtpuser = rohit.ashiwal265@gmail.com | |
smtpserver = smtp.office365.com | |
smtpuser = rashiwal@studentambassadors.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Subject: testing | |
hello world | |
Thanks | |
Rohit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name | ||
---|---|---|
Rohit Ashiwal | rohit.ashiwal265@gmail.com | |
Rohit Ashiwal | rashiwal@cs.iitr.ac.in | |
Vedant | vedron007@gmail.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
joblib==0.16.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
from subprocess import call | |
from joblib import Parallel, delayed | |
recipients = [] | |
def send_email(name, email): | |
call(['git', 'send-email', '--from=Rohit Ashiwal <rashiwal@studentambassadors.com>', | |
f'--to={name} <{email}>', '--suppress-from', '--confirm=never', 'email.txt']) | |
with open('recipients.csv', 'r') as file: | |
reader = csv.DictReader(file) | |
for row in reader: | |
recipients.append((row['Name'], row['Email'])) | |
Parallel(n_jobs=50, prefer='threads')(delayed(send_email)(name, email) for (name, email) in recipients) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment