Send email from the command line

runs on Linuxruns on Macruns on Windows
screenshot of SendEmail

There are lots of straightforward ways to send email out there, with all kinds of email client applications. There are some more complicated ways to send email as well, like talking directly to sendmail or postfix. Apps with GUIs are nice for humans, but not so easy to incorporate into scripts. Command line tools are scriptable, but they can be complicated to set up, configure and run. There is, however, a third way.

SendEmail is a Perl script that you can use to send email messages either directly from the command line, or by incorporating its functionality into batch files or shell scripts. You basically include all the regular bits and pieces required for any email message—to, from, subject, body, name of the SMTP server you're using—in the command that invokes the app, and then just send the message. While it may be a bit complicated to do this from the command prompt yourself, sticking it all into a script is pretty easy, and now you can send messages programmatically.

A free download, SendEmail is available with installers for Linux and Windows, although it's no great challenge to use it on your Mac as well. All you need is a Perl install on your system, and you're good to go.

Download SendEmail

Leave a Reply

You must be logged in to post a comment.