03 Jun, 2008
Get WordPress to use sendmail instead of mail()
Posted by: Jennifer In: WordPress|WordPress Hacks
Same project I just mentioned below – something funky was going on with WordPress not sending emails. I had a server admin looking at the server and I'd submit a comment on the corporate blog and no emails would get sent. I even tried using a plugin that forced wordpress to use SMTP, still would not send emails from the blog.
I found on the support forums where someone mentioned a hack to get WordPress to use sendmail. In wp-includes folder open the file pluggable.php. Around line 362 is the following:
// Set to use PHP's mail()
$phpmailer->IsMail();
Change that to:
// Set to use PHP's mail()
//$phpmailer->IsMail();
$phpmailer->IsSendmail();
As soon as I did that – voila – it started sending emails.
(yes, I know, I'm modifying core code again. Tell me how to make this a plugin and I will!)