pymail : Sending emails from terminal.
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
- -a –to-address: Receiving addresses separated by commas.
- -A –ads-file: Read the addresses from a file. The addresses should also be separated by commas in the file.
- -s –subject: Subject of the sending email.
- -t –text: Body of the message.
- -T –text-file: Read the message from a file.
- -f –att-file: Attached file names separated by commas.
- -h –help: Show help information.
- -d –defaults: Show default settings.