Skip to content

Send Email from the console line using a python3 script

Notifications You must be signed in to change notification settings

lordvins226/send_email

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

send_email

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.

Setup

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": "xxx@gmail.com",
  "password": "xxxxxx",
  "port": 587,
  "server": "smtp.gmail.com"
}

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 sending.py receiver@gmail.com -c config.json -s subject.txt -a 'Attachement Of The Mail : SENDED USING PYTHON3'

About

Send Email from the console line using a python3 script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%