Tuesday, January 05, 2010

Setting up wordpress MU to work with authenticated SMTP Mail Server


I really don't like having sendmail running on a webserver, but some features of WordPressjust 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 /wp-includes/pluggable.php around line 377, change

 	$phpmailer->isMail();

to

 	$phpmailer->isSMTP();

Then, in /wp-includes/class-phpmailer.php 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 MailSMTP.


For my redfoxhosting hosted SMTP server, the settings were:
true
password

Easy (but took 4 go's to get right!)

No comments:

Post a Comment