Table of content

About the project

This python3 script allow you to send email from the terminal using a json file as configuration file and a .txt file as the subject for the mail.


Install required packages

cd send_email
$ pip install -r requirements.txt

Create the config.json file with your credentials . This configuration file is for gmail
Change port and server for others smtp providers.

  "email": "[email protected]",
  "password": "xxxxxx",
  "port": 587,
  "server": ""

Remove reading write to the config file for other user to protect your credential

$chmod 600 config.json

Create a text file with the subject:

echo "The message to be send" > subject.txt

Send the mail:

python3 [email protected] -c config.json -s subject.txt -a 'Attachement Of The Mail : SENDED USING PYTHON3'


View Github