pymail : Sending emails from terminal.

15 Nov 2018

Installation

pymail is a python3 script that sends emails within terminal. The main library I used here is smtplib. In my daily work, sometimes it takes days running a program before getting the result, so that I use this script to send data to my laptop from my work station after the process is done. This has saved me a lot fo time. To use the script, simply copy the script into any directory you want and symlink the file to a directory that is included in your $PATH, for instance /usr/local/bin, then reopen the terminal.

Setup

Firstly, you may need to change the first line to the directory where your python3 is. Then please change the following as show.

userName = 'username of your mail box'
passWord = 'application specific password of your mail box'
toAddress = ['default receiving e-mail address']
subJect = 'default subject'
textMsg = 'default message.'

Usage

pymail [-a<to_address>,<to_address>,...|-A<address-file>] [-s<subject>] [-t<text>|-T<text-file>] [-f<attached_file>,<attached_file>,...] [-h] [-d]

Options