Skip to content

Commit 66d0c5e

Browse files
authored
Add files via upload
1 parent 5dcf6b9 commit 66d0c5e

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Diff for: AutomationScripts/Email Sender In Bulk/email.csv

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[email protected],nick,premium
2+
[email protected],name,premium
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import csv
2+
import smtplib
3+
from email.mime.text import MIMEText
4+
from email.mime.multipart import MIMEMultipart
5+
6+
7+
email_user = "[email protected]" #enter your mail id
8+
password = "pass" # enter the password of your mail
9+
subject = "Email Validation"
10+
11+
#reading the email file
12+
with open('email.csv','r')as csvfile:
13+
reader = csv.reader(csvfile)
14+
for line in reader:
15+
text = "hello "+line[1]+" your "+line[2]+ " plan has been activated"
16+
# print(text)
17+
email_send = line[0]
18+
msg= MIMEMultipart()
19+
msg['From'] = email_user
20+
msg['To'] = email_send
21+
msg['Subject']= subject
22+
msg.attach(MIMEText(text,"plain"))
23+
text = msg.as_string()
24+
25+
#establishing the server
26+
server = smtplib.SMTP_SSL("smtp.gmail.com",465)
27+
server.login(email_user,password)
28+
server.sendmail(email_user,email_send,text)
29+
30+
server.quit()

0 commit comments

Comments
 (0)