Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 952430d

Browse files
Mailing Automation
1 parent fb1a147 commit 952430d

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

β€Ž0x20-AutomatedMailing/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Automated Mailing
2+
3+
## πŸ› οΈ Description
4+
5+
This code helps automate the process of sending mail to large audience.It takes email addresses stored in the CSV file.
6+
7+
## βš™οΈ Languages or Frameworks Used
8+
9+
Modules required are `os` , `email.mime` , `smtplib` , `pandas`.
10+
11+
These are listed in `requirements.txt` . USe the below command to install these dependencies.
12+
13+
```pip install requirements.txt```
14+
15+
## 🌟 How to run
16+
17+
- Update the `from_addr` and `pd.read_csv("filepath")`
18+
- Assign `email` with your email-id & `password` with your e-mail password.
19+
- Run script
20+
21+
22+
## πŸ€– Author
23+
24+
[Pradhyuman Arora](https://github.com/pradhyumanarora)

β€Ž0x20-AutomatedMailing/mail.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from os import name
2+
import pandas as pd
3+
import smtplib
4+
from email.mime.multipart import MIMEMultipart
5+
from email.mime.text import MIMEText
6+
7+
8+
from_addr='ENTER_SENDERS_MAILID'
9+
10+
data=pd.read_csv("abc.csv") # Enter path of CSV files containing emails
11+
to_addr=data['email'].tolist() # Change'email' to column name containg emailids
12+
name = data['name'].tolist()
13+
14+
l=len(name)
15+
16+
for i in range (l):
17+
msg=MIMEMultipart()
18+
msg['From']=from_addr
19+
msg['To']=to_addr[i]
20+
msg['subject']='Just to Check'
21+
22+
body=name[i]+'Enter your content here'
23+
24+
msg.attach(MIMEText(body,'plain'))
25+
26+
email="" #Enter Your email id here
27+
password="" #Enter your Password
28+
29+
mail=smtplib.SMTP('smtp.gmail.com',587)
30+
mail.ehlo()
31+
mail.starttls()
32+
mail.login(email,password)
33+
text=msg.as_string()
34+
mail.sendmail(from_addr,to_addr[i],text)
35+
mail.quit()
54 Bytes
Binary file not shown.

0 commit comments

Comments
(0)

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /