SMTPstoat – Open Source command line SMTP mailer

SMTPstoat is a command line SMTP mailer application that sends out e-mails according to various specifications.

There are plenty of apps that include the name ‘weasel’ and ‘ferret’, so I decided that stoat shouldn’t be left out.


  1. Create and send an entire e-mail via the command line.
  2. Send an e-mail via settings in a configuration file.
  3. Forward out a raw e-mail message file.
  4. Send attachments.
  5. SMTP authentication support (AUTH LOGIN).
  6. Send to multiple addresses.

License: GNU General Public License (GPL)
Programming Language: C++


Binary DownloadSizeVersionDate
smtpstoat-1.0.104.linux.tar262,646b1.0.104May 03, 2006
smtpstoat-1.0.104.win32234,689b1.0.104May 03, 2006


Source DownloadSizeVersionDate
smtpstoat-1.0.104.tar151,737b1.0.104May 03, 2006

SMTPstoat compiles for Win32 and Linux platforms.

Sending an e-mail

[user@localhost]$ smtpstoat -w /home/user/stoat/ -S -f -t “,” -s “This is a test” -m “Sending data.tar.gz” -a /home/user/data.tar.gz -v

Required parameters

SMTPstoat needs to know what directory it can use for creating e-mail files. This is specified by the “-w” parameter:

-w (working directory)

Note: You must specify the full directory path, but it is not necessary to add the path separator to the end “/”.


Send mail via command line parameters only

If no config file is specified, you must set the following arguments at the command line:

-S (server name)

-t (“to@address[, to@addressN]”)

-f (from address)

To create your own e-mail, use the following parameters:

-s (“subject text here”)

The following are optional arguments:

-m (“message text here”)

-M (path/to/message/text/file) (use file contents for message)

-P (port) (default = 25)

-h (helo domain) (default = localhost)

-A (username:pass) (use SMTP authentication – AUTH LOGIN)

-a (attachment)[( attachmentN)] (specify as many attachments as you like)

-v           enables verbose mode (default = off)


Sending mail via a config file

You can specify a config file, and any attachments as so…

-c (config file)

smtpstoat -w (working directory) -c (config file) [-a (attachment) [(attachmentN)]]

The config file should be set out as follows:

(smtp server)[:(port)] (helo domain)
(from address)
(to address(es))
(message text)

This is the subject
Text typed here is used as the message text.

You can enter as much as you like.


Sending a raw e-mail file

You can specify that a raw message file is to be sent as so…

-r (/path/to/msg/file)

You can specify a config file, and a raw e-mail file to send:

smtpstoat -w (working directory) -c (config file) -r (path/to/msg/file)

Or specify the required parameters, and a raw e-mail file:

smtpstoat -w (working directory) -S (smtp server) -f (from address) -t (“to address(es)”) -r (path/to/msg/file)

The e-mail file itself should be constructed according to the RFC requirements, ending with CRLF.CRLF