Stay Connected
WordPress: external SMTP server setting
Recently 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.

I used WinSCP to connect with SSH and change the files. Again posted some comments and received the admin notifications in my Inbox.
| Print article | This entry was posted by Ivan Versluis on February 9, 2009 at 3:50 pm, and is filed under Wordpress. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |

about 1 year ago
Hi.
Thanks for this tutorial. I need help with it.
Could you be more specific as to what I have to change for WP notification to go through in class-phpmailer?
Also, my cforms plugins isn’t working. The messages sent with the cforms don’t go through.
You can see this form at blackberryrocks.com/contact.
Would you be able to help? Thanks!
about 1 year ago
I’m using WP 2.7.1 on a virtual dedicated server, just in case.
about 1 year ago
That
about 1 year ago
this worked perfectly! Now I get comments!
about 1 year ago
I tried this sugguest and it everything I added a post or added a new user I got a white screen. I had to revert back. I’m using 2.8.2 I’m not sure what else I can do to recieve emails when someone post a comment this was working before I updated. Any?
about 11 months ago
A WP plug-in exists that does this without having to hack php pages.
Try this:
http://wordpress.org/extend/plugins/wp-mail-smtp/
about 8 months ago
I’ve tried this, alas no success. I’m on WP 2.8.6, so who knows. I’ve tried various contact form plugins and such, and I give up. The easiest thing to do seems to create a “Contact” page and just stick in an email link like this:
E-mail Me!
Works just fine everytime, and all the rest of this stuff is way too confusing.
about 3 months ago
Facebook Şifre Alma Programı
Bilgisayara Girme Programı
about 3 weeks ago
i am happy to find it thanks for sharing it here. Nice work.
about 3 weeks ago
Thank you!