[wp-hackers] Help with wp_mail(), PHPMailer, and CC vs BCC

Mike Walsh mpwalsh8 at gmail.com
Wed Oct 9 00:01:39 UTC 2013

I understand that wp_mail() is pluggable, in fact, I am concerned that may
be the source of these curious problems.  I've been working with a  user
for the last couple hours to chase this down and now it isn't happening any
more.  She tells me all her plugins and themes are as they were earlier but
something doesn't pass the sniff test.

Is there a way to determine if wp_mail() has indeed been overloaded?

I was able to use the phpmailer_init filter to dump the status of the
PHPMailer instance just before mail is sent so that was helpful.  It would
be nice if wp_mail() had a similar filter but unfortunately it does not.  I
don't want to distribute a modified version of wp_mail() with my plugin
either as I don't need anything but the standard behavior.


On Tue, Oct 8, 2013 at 5:28 PM, Shea Bunge <info at bungeshea.com> wrote:

> wp_mail() is a pluggable function, so you can just copy it into a plugin
> and modify it how you like. Your custom wp_mail() will be used instead of
> the default function.
> On Wed, Oct 9, 2013 at 8:24 AM, Mike Walsh <mpwalsh8 at gmail.com> wrote:
> > I am getting reports from a few users that my Email Users plugin is
> putting
> > recipient addresses in the CC header instead of the BCC header.  I am
> > stumped as to how this is happening but I've had three reports in the
> past
> > 24 hours.
> >
> > Is there anyway to intercept PHPMailer from actually performing the final
> > send?  What I'd like to do is let the plugin run normally right up to the
> > point where wp_mail() calls PHPMailer and then prevent PHPMailer from
> doing
> > the actual send.  I'd then like to examine the headers in the PHPMailer
> > global instance to try and figure out what is going haywire.
> >
> > I've looked through wp_mail() and the PHPMailer class and I don't see any
> > obvious way to do this so am hoping someone has had to do something
> similar
> > before.  There is a reference in wp_mail() to a hook called
> > 'phpmailer_init' but I haven't found out what it is used for nor when it
> is
> > called.
> >
> > Mike
> >
> > --
> > Mike Walsh - mpwalsh8 at gmail.com
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> --
> Regards,
> Shea Bunge
> http://bungeshea.com
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

Mike Walsh - mpwalsh8 at gmail.com

More information about the wp-hackers mailing list