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 (https://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?
- The topic ‘The mythical wp_mail function’ is closed to new replies.