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 cam enjoy freedom of sending emails from command line. Or you can also download Max OS X Binary of mailsend from here
send email with attachment and copy to given address:
mailsend -smtp localhost -t [email protected] -f [email protected] -attach attachment.zip -name from_name -M "bodycopy"
let’s send email RAW email using GMAIL account:
mailsend -starttls -auth -smtp smtp.gmail.com -user [email protected] -pass mypass -t [email protected] -f [email protected] -attach test.zip,application/zip,a -name me -msg-body test.txt -sub email with attachment
Send email using Amazon SES
mailsend -starttls -auth -smtp email-smtp.us-east-1.amazonaws.com -user KEY -pass PASS -t [email protected] -name me -f [email protected] -sub test -M "message"