Command Line Email

Filed under EMail, Utilities

Every once in a while, I’ve run into the need to send an email via the command line. Often, this is during make scripts, or other long processing batch jobs. I’ve almost always ended up succumbing to “net send” and being done with it, but that’s not an option anymore with Vista. The good ol’ (and much maligned) Messenger service is no more under Vista and Server 2008.

So, I need to send an email via command line.

There’s piles of little email apps like this floating around, but most don’t support TLS, secure sockets or authenticated smtp access, which, for better or worse, is what GMail requires now.

After a good deal of searching, I ended up coming across the very nice (and free), MailSend utility by Muhammad A Muquit.

Sending email from the command line is a simple (albeit a tad long winded) command, all on one line of course:

mailsend -from you@gmail.com -to someone@domain.com +cc +bc -d gmail.com 
    -smtp smtp.gmail.com -v -starttls -auth-plain -user you@gmail.com -pass "yourpassword" 
    -sub "Test Subject" -M "This is the body of a test message"

Quite handy.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*