Sending emails from commandline

Sending emails from commandline

Pretty easy but annoying task. Especially when you want to send email using specific SMTP server, or from GMAIL using SSL or add some attachment, or send RAW emails. Solution is there – mailsend . Extremely simple command line tool for Linux, Mac OS X and even Windows ;). Compile / download binary and you can enjoy freedom of sending emails from command line.

Sample usage:

send email  with attachment and copy to given address:

mailsend -smtp localhost -t -f -attach -name from_name -M "bodycopy"

let’s send email RAW email using GMAIL account:

mailsend -starttls -auth -smtp -user -pass mypass -t -f -attach,application/zip,a -name me -msg-body test.txt -sub email with attachment

Send email using Amazon SES

mailsend -starttls -auth -smtp -user KEY -pass PASS -t to@email.address -name me -f confimed@email.address -sub test -M "message"