A Python based command line tool allowing to send custom bulk emails.
This project is developed using these technologies:
- Programming Language: Python 3.7.6 x64
- Libraries:
- smtplib (SMTP protocol client): https://docs.python.org/3/library/smtplib.html
- Integrated Development Environment: Microsoft Visual Studio code x64
For now, two actions (commands) might executed :
- Sending test email
- Sending cutom bulk emails
Important : for both commands, you have to set the
config.json
file (see below).
{
"server": "SERVER",
"port": "SERVER_PORT",
"username": "USERNAME",
"from": "EMAIL_ADDRESS",
"password": "PASSWORD"
}
At any time, you may execute the command python ./run.py -h
to display the help & instructions:
usage: run.py [-h] [-t] [-e] [-b] [-s] [-m] [-d] [-l]
Send Custom Bulk Emails by Yacine YADDADEN [ https://github.com/yyaddaden ]
optional arguments:
-h, --help show this help message and exit
send test email:
-t, --test send test email
-e , --email email address for testing
send bulk emails:
-b, --bulk send bulk emails
-s , --subject subject in bulk emails
-m , --mail text file for the mail template
-d , --data csv file for the data to include
-l , --limit max emails per connection
Description : this command aims to verify and ensure that the
config.json
file is set correctly by sending a test email.
This command requires two parameters :
-t
to choose the testing operation,-e EMAIL_ADDRESS
to indicate the email address to whom the test email will be sent.
Description : this command aims to send customized bulk emails.
This command requires four parameters :
-b
to choose the bulk email operation,-s "SUBJECT"
to specify the subject of the emails,-m FILE_NAME.TXT
to specify the mail template file (.txt file) with variables that will be used,-d FILE_NAME.CSV
to specify the data file (.csv file with commas as separator) with values that repalce the variables.
Example of data file (.csv file):
ending_date,title,name,email
10 july 2020,Mr,Alex,[email protected]
30 August 2020,Mme,Sofia,[email protected]
Important : in the data file (.csv file with commas as separator), a variable is required which is
Example of mail template file (.txt file):
Hi %title% %name%,
We inform you that your subscription ends in %ending_date%.
Thank you.
Which gives after replacing the variable for the first row of the data file (.csv file):
Hi Mr Alex,
We inform you that your subscription ends in 10 july 2020.
Thank you.
Managing limitation : sometimes, the used server has a limitation in terms of number of emails to send per connection. In order to overcome this limitation, you can specify an optional parameter
-l NUMBER_EMAILS_PER_CONNECTION
. There will be 60 seconds between two connections.
For now, there are three main features which consist in :
- Sending a test email in order to verfiy the configuration,
- Sending bulk custom emails which is the main feature,
- Saving the logs for every performed operation in
logs.txt
.
In order to contribue to this project, there are two options :
- Option 1 : ๐ด Fork this repo!
- Option 2 : ๐ฏ Clone this repo to your local machine using
https://github.com/yyaddaden/bulk-emails-app.git