Using WordPress With External SMTP Server

I really don’t like having sendmail running on a webserver, but some features of WordPress just don’t work if it can’t send email (user registration, for example). Still, WordPress offers support to send email through external SMTP servers instead if a local mailer.

In <a href="http://trac.wordpress.org/browser/tags/2.6.3/wp-includes/pluggable.php">/wp-includes/pluggable.php</a> around line 377, change

``` $phpmailer->isMail(); ```

to

``` $phpmailer->isSMTP(); ```

Then, in <a title="/tags/2.6.3/wp-includes/class-phpmailer.php - WordPress Trac - Trac" href="http://trac.wordpress.org/browser/tags/2.6.3/wp-includes/class-phpmailer.php">/wp-includes/class-phpmailer.php</a> around line 155, set your SMTP host:

``` var $Host = "my.smtphost.com"; ```

You may also need to set a username and password, and tell WP to attempt authentication. You’ll see those in the lines below the hostname variable.

``` var $SMTPAuth = true; var $Username = "username"; var $Password = "password"; ```

On the other hand, you could do this via a plugin, perhaps even Callum McDonald’s WP Mail SMTP.