Wordpress LogoRecently I installed and configured a WordPress appliance. The vm was running in a intranet environment and we had only single SMTP server which allowed to relay into the Exchange organization.

The vm appliance was download and it had a admin option to configure the SMTP relay server. I configured correct IP address of the SMTP server but when I posted comment or any other action where WordPress needed to send out an email it took 30-60 seconds before the action was finished. After waiting for some minutes I also did not receive any email from the system.

Before troubleshooting and spending whole day in finding the root cause I found some posts how to change WordPress default behavior for email notifications. The vm has all LAMP roles and WordPress version 2.7 is running.

How to change WordPress to use SMTP server?

  • Go to ./wordpress/wp-includes and open file “pluggable.php”
  • Search for “$phpmailer->IsMail();” and change the phpmailer setting to “$phpmailer->IsSMTP();” ; save and close the file
  • Go to ./wordpress/wp-includes and open file “class-phpmailer.php” and search for “var $Host“; localhost should be defined. Change this to appropriate SMTP server in your environment. Save and close the file.
    SMTP Server WordPress

I used WinSCP to connect with SSH and change the files. Again posted some comments and received the admin notifications in my Inbox.