SMTP supported tools

Published November 15, 2015 08:35:16 AM  |  Last update May 4, 2017 11:59:32 AM
Tags: smtp, php, email

Linux sSMTP

sSMTP is a program to deliver an email from a local computer to a configured mailhost (mailhub). It is not a mail server (like feature-rich mail server sendmail) and does not receive mail, expand aliases or manage a queue. One of its primary uses is for forwarding automated email (like system alerts) off your machine and to an external email address.

To install ssmtp, on DEB platforms, simply use the following command,
apt-get install ssmtp
apt-get install mailutils

On having the installation done, configure ssmtp using the settings in:
as followings,

# Config file for sSMTP sendmail
# catch-all email address:
# Make this empty to disable rewriting.

# The place where the mail goes.
# MX records are consulted.
mailhub=smtp-server : smtp-server-port

# Where will the mail seem to come from?

# The full hostname, important,
# for VPS: it should be set in reverse DNS (see /etc/hosts)

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
UseTLS=YES       # secured mailbox
AuthMethod=LOGIN # oAuth used, such as Gmail


echo "email body" | mail -s "email subject" receiver-email-address

Using ssmtp with PHP mail function

  • in the php.ini file (/etc/php5/fpm/php.ini for Debian), search and set
    sendmail_path = /usr/sbin/ssmtp -t
  • Restart PHP web server
  • To test mail function at shell command prompt
    php -a

Using ssmtp with Wordpress

  • Open pluggable.php (located at wp-includes) using your text editor.
  • Replace,
    // Set to use PHP mail()
  • Enjoy your blog with ssmpt using any smtp-enable email account.

Please notice that SSMTP is no longer being developed. You might want to consider an alternative like MSMTP.

web builder  tnWeb_1.54 – powered and hosted by tinyray