CLI utility for sending emails via SMTP and Amazon SES
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Mailstrom is a command-line script for sending emails via SMTP or Amazon SES.

It behaves similarly to the UNIX mail command, in that it can accept an email body via a pipe and then transmit it over the configured protocol to the specified destination:

$> echo "Testing" | bin/mailstrom -s "My Subject"

It can also be used interactively to write emails, just like mail (press Ctrl+D on a blank line to signal the end of input):

$> mail -s "My Subject"
Dear Sir or Madam,

I would like to tell you about how awesome the developer of Mailstrom is, and how 
you should totally follow his blog at and perhaps even 
sign up for his forum-as-a-service offering at


Testy Q. McTesterson

Sendmail and Postfix can be a hassle, and are largely overkill for most cloud servers, so with Mailstrom you can save yourself the maintenance headaches of maintaining your own mail daemons on your multitude of servers/instances.

... this can be nothing else than the great whirlpool of the Maelström ...
... in the centre of the channel of the Maelström is an abyss penetrating the globe ...
... the ordinary accounts of this vortex had by no means prepared me for what I saw ...


Fetch from Github and install dependencies using Composer:

$> git clone git:// mailstrom
$> cd mailstrom
$> curl -s | php
$> ./composer.phar install

Configure it to be available in your $PATH:

$> cd /usr/local/bin
$> ln -s /path/to/mailstrom/bin/mailstrom mailstrom

Or, if you wish, configure it as a drop-in replacement for the "mail" command (presuming it does not currently exist):

$> cd /usr/local/bin
$> ln -s /path/to/mailstrom/bin/mailstrom mail


Mailstrom looks in /etc/mailstrom.ini and ~/.mailstrom.ini for connection settings, but you can also specify other fields (From/To/Subject/Message) in the INI file. From/To/Subject/Message values specified on the command line take precedence over the INI values.

An example Amazon SES configuration file would look like:


Alternatively, an SMTP configuration file would specify a "type" (Amazon SES is assumed to be the default type) as well as SMTP-specific settings:

smtp_user=username (optional)
smtp_pass=pass (optional)
smtp_encryption=ssl (optional. Supports ssl and tls. Omit this setting to leave encryption disabled.)

Note: Some passwords with special characters may need to be quoted in the INI files, in order to prevent parse_ini_file from throwing errors:

smtp_pass="This password is SPECIAL!!!11!"


As mentioned above, this is intended to be somewhat of a replacement for the mail command, so you can use it like this:

$> cat MyFile.txt | mailstrom --to --subject "Output of MyFile.txt"

Or you can specify the message as a string:

$> mailstrom --to --subject "Output of MyFile.txt" --message "My email message"


Built by Kevin Boyd ( | ) using Amazon's AWS SDK for PHP 2, GetOptionKit, and SwiftMailer.

Note: This project is in no way related to the Mailstrom "Inbox Zero" mail client.