Title: The mythical wp_mail function
Last modified: August 18, 2016

---

# The mythical wp_mail function

 *  [eosyn](https://wordpress.org/support/users/eosyn/)
 * (@eosyn)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/the-mythical-wp_mail-function/)
 * Ok, before I get too far into this, I just want to lay out that I’m not a PHP
   ace (yet) and its very possible there are things I am overlooking.
 * I am running wp1.5 (and have since the beta). Yahoo stuck my blog on their ‘hey
   everyone go see this site’ thingie and many, many people did. Not good for a 
   DSL line no? So, I had to take my otherwise perfectly functioning wp install 
   and move it to a friends machine which is on a 100mbps line. I got the whole 
   site working and all except, I dont get comment notifies or spam moderation notifies.
   So, my setup is like such:
 * I do not have root and my friend is hard to get a hold of.
    The server has some
   very weird qmail setup (once again the admin cant fix that up til he re-learns
   qmail) So, I cant use the local email server, I cant edit php.ini to point it
   elsewhere and doing so would be a bad idea. WP appears to eventually use the 
   built in php mail() function via @wp_mail(). So I’ve traced down the two functions
   that appear to do the mailing jobs in question. wp_notify_moderator() and wp_notify_postauthor().
   I’ve looked around for solutions to this in WP and havent found any that fit 
   my problem of using an external smtp server. While looking, I did find a mention
   of the phpmailmailer ([http://phpmailer.sourceforge.net/](http://phpmailer.sourceforge.net/))
   class to send mail so I backed up the comment-functions.php file and tried (perhaps
   not smartly) to umm. temporarily incorporate the class into the functions. For
   the most part its almost a drop in but no matter what I do, I cant even get WP
   to use it, gosh, I cant even get WP to break (and I did try.. big printf’s before
   a header should do it) but to no avail. A case of WP being too stable 🙂
 * So that tells me that perhaps its not using the functions? I’m wondering just
   how wp sends the mail to authors and such if not via these two functions and 
   mail().
 * About phpmailer, to speed in the processes of elimination, I wrote a quick little
   script alone with it and it worked fine from the server.
 * Sorry its so long. Anyone know about the mail stuff or any obviously easy way
   to set an external smtp without being root?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Scott Reilly](https://wordpress.org/support/users/coffee2code/)
 * (@coffee2code)
 * WordPress & Plugin Developer
 * [21 years, 2 months ago](https://wordpress.org/support/topic/the-mythical-wp_mail-function/#post-154957)
 * [wpPHPMailer](http://www.coffee2code.com/archives/2004/06/28/plugin-wpphpmailer/)
   is a plugin that includes PHP Mailer to send mail through an SMTP server (and
   bypass any attempts to use sendmail via mail()). I’m updating the plugin this
   week, but it should work as described at the site. The only change you have to
   bear in mind is that in WP 1.5 you only have to change one line of code instead
   of four; in wp_mail() change the [@mail](https://wordpress.org/support/users/mail/)
   call to @phpmailer (after you’ve activated the plugin, that is)
 *  Thread Starter [eosyn](https://wordpress.org/support/users/eosyn/)
 * (@eosyn)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/the-mythical-wp_mail-function/#post-154993)
 * Oh my! Thank you a bunch!
 *  [theferf](https://wordpress.org/support/users/theferf/)
 * (@theferf)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/the-mythical-wp_mail-function/#post-155786)
 * whats the chance that there is an updated version of this plugin for 2.0? Im 
   afraid to use a 1.5 plugin with 2.0
 *  [theferf](https://wordpress.org/support/users/theferf/)
 * (@theferf)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/the-mythical-wp_mail-function/#post-155787)
 * ok. i couldn’t resist, so i went ahead and installed wp-phpmailer plugin on WordPress
   2.0 install. My server for some reason does not send using sendmail, only SMTP.
   after the simple configuration of the script, I was receiving emails for registered
   users just fine. i still need to test comments, etc but so far so good!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘The mythical wp_mail function’ is closed to new replies.

 * 4 replies
 * 3 participants
 * Last reply from: [theferf](https://wordpress.org/support/users/theferf/)
 * Last activity: [20 years, 3 months ago](https://wordpress.org/support/topic/the-mythical-wp_mail-function/#post-155787)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
