README
Sendmail - Write html email quickly and send it at terminal
Sendmail is a perfect tool for programmers who prefer to use terminal vim as editor and want to write complicated email easily with markdown syntax and highlight enabled.
Install
git clone https://github.com/chemzqm/sendmail.git
cd sendmail
npm install
Configuration
Change file
sendmail/lib/profile.json.exampletosendmail/lib/profile.json.Change text in
[]of profile.json to your settings.Below is an example of gmail settings:
{ "server":{ "user":"chemzqm", "password":"********", "host":"smtp.gmail.com", "port":587 "tls":true }, "headers":{ "from":"chemzqm <chemzqm@gmail.com>" }, "footer":"Thanks,<br />Jack\n", // will be added to the end of your email "contacts":{ "chemzqm":"chemzqm <chemzqm@gmail.com>" } }Server settings is the same as project: emailjs.
Headers is the default head you want to set for your email, including
from cc to subjectetc.Contacts is used for convenient input of contacts emails, all the contact's names will be added to the end of email file you are editing, and what you need to do is just type the
property nameof contacts seperated by,to the fieldstoand/orcc, the property name will be converted to property value before email sending.
Usage
Make sure path
~/binis included in$PATH, if not, add below to your file~/.bashrcexport $PATH=$PATH:~/binEnable sendmail by :
$ ln -s /full/path/to/bin/sendmail ~/bin/sendmailSend a new email:
$ sendmailwith optional file content as email content
$ sendmail filenameGet help:
$ sendmail -h Usage: sendmail [options] [number|filename] Options: -h, --help output usage information -V, --version output the version number -l --list show all mails with filename number subject -e --edit <number|filename> edit previous mail and send -s --send <number|filename> send email without using vim to edit -d --delete <number|filename> remove email, could be number separated by comma like: 0,1,2 -c --cat <number|filename> show email content, coulad be number separated by comma like: 0,1,2 -g --grep <text> grep text in all emails -p --profile <name> use profile when sending email specified by name
Notice
Multi profile support and attachment is not supported yet.
License
MIT