Low memory usage SMTP Send-Only

Often when installing a web application or script you need an SMTP server to send email but rarely there is the need to recieve any email and on those occasions it is unnecessary to set up an full blown SMTP server like Postfix, Sendmail or Exim. It works equally well using ssmtp, which also is simple and fast to install. It takes two minutes to install and configure.

Start the installation with apt-get:

The configuration is done in the /etc/ssmtp/ssmtp.conf and there is not much needing to be configured:

The mail server you must send mail through (relay). In this guide we will use GMail smtp Server.
From Line Override
Set to YES to allow the use of others choose from addresses other than the system itself.
The username or email adress on the account used to login to gmail.
The password for above account
Set to Yes to use TLS when connecting to the SMTP server.

No reboots required. Ssmtp create / usr / sbin / sendmail, such as PHP uses to send mail. You have no open ports, everything just works.

6 comments for “Low memory usage SMTP Send-Only

  1. yywudi
    July 18, 2013 at 07:03

    really good, when running wordpress, we may need to send some comment reply notification mail or database backup mail, so I think this is OK and enough for such implenmentation?

  2. yaning
    July 31, 2013 at 10:49

    not work! always got err:send-mail: Authorization failed (534 5.7.14 54 tr10sm768553pbc.22 – gsmtp)

  3. yaning
    July 31, 2013 at 11:59

    changed the mail password once ,then it works fine

    • July 31, 2013 at 18:51

      There you go!
      Glad that it is to good use.

  4. SegmentationFault
    November 14, 2013 at 21:36

    ssmtp is too restrictive and can only send through a single smtp server.

    smtp-cli is much more powerful.


    • November 15, 2013 at 10:02

      Sometimes you only need one SMTP server, as an example if you are forced to use a smarthost.
      at my regular job we block port 25 from our customers servers and force them to use the mailrelay that we have setup instead.

      I’m not bashing your suggestion, it’s just another way of doing it 🙂 Thank you for sharing your knowledge.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.