Perl-based command line SMTP client with SSL/TLS support to test configurations of SMTP servers.

Special features like build-in Text-Substitution for subject and/or header-fields to test spam-filters. Include message texts from a string, file or dynamically created. Support HTML messages and attachments. Other options like number of repetitions and delay per TCP-connection to send multiple messages. Show complete client/server communication on STDOUT and optional log to external file(s) for debugging.

Table of content


Download and extract the source-tarball: tar xvf mailertls-VERSION.tar.gz


--config Uses the specified configuration-file
--host Set the host name or address of the SMTP server
--port Set the port where the SMTP server is listening (default is 587 for SSL/TLS)
--hello Set the hostname used in the EHLO command (default is localhost)
--timeout Close the connection after the specified time in seconds (default is 10)
--user Username for SMTP AUTH required in plain-text
--pass Password for SMTP AUTH required in plain-text
--from Address to use in MAIL FROM command
--to Address to use in RCPT TO command
--subject Subject of the message
--body Plaintext of the message
--attachment Sends the specified file as attachment
--verbose Explain what is being done. Output the client-server communication
--help Print a brief help message and exits
--man Prints the manual page and exits


The easiest way to send a single mail is to use a configuration file. Except password and recipient, all parameters are used from this file. mailertls --config mailertls.conf --pass secret --to "" The configuration can look like this:
  #file: mailertls.conf
  text="Hello, Message from mailtools"


This feature is useful if you want to send a huge amount of mails to one postbox. The substitutions are specified with curly braces around the filename(s). Each possible value is represented by one line.
  #file: mailertls.conf

Using a proxy

The following command sends a mail by using the given configuration file through a SOCKS4 proxy to hide the original source IP:
mailertls --config mailertlsconf --to "" --proxy ""

Other examples

Sending with attachment
mailertls --config mailertlsconf --to "" --attachment ~/filename
Multiple recipients
mailertls --config mailertlsconf --to "" --to ""

Copyright and License information

mailertls Copyright © 2013 Marco Opper

This program is released under the GNUv3 License.