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 hidden or 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 = [email protected] | |
email = [email protected] | |
[sendemail] | |
smtpencryption = tls | |
smtpserverport = 587 | |
smtppass = **your password** | |
#smtpserver = smtp.gmail.com | |
#smtpuser = [email protected] | |
smtpserver = smtp.office365.com | |
smtpuser = [email protected] |
This file contains hidden or 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 hidden or 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 | [email protected] | |
Rohit Ashiwal | [email protected] | |
Vedant | [email protected] |
This file contains hidden or 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 hidden or 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 <[email protected]>', | |
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