[wp-trac] [WordPress Trac] #14710: PHPMailer class can cause an already declared error if including wp-config in an external script
WordPress Trac
wp-trac at lists.automattic.com
Fri Aug 27 11:19:31 UTC 2010
#14710: PHPMailer class can cause an already declared error if including wp-config
in an external script
------------------------------+---------------------------------------------
Reporter: teamplaylotto | Owner:
Type: feature request | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: Mail | Version: 3.0.1
Severity: normal | Resolution: wontfix
Keywords: phpmailer, class |
------------------------------+---------------------------------------------
Changes (by teamplaylotto):
* status: new => closed
* resolution: => wontfix
Comment:
Replying to [comment:1 hakre]:
> {{{wp_mail()}}}, the function which takes care of the include of {{{/wp-
includes/class-phpmailer.php}}}, is a so called plugable function.
>
> You can replace it with your own implementation that takes care to not
load phpmailer a second time.
>
> Additionally and more easily than writing your own mail function, you
can hook into {{{wp_mail}}} filter and execute {{{$GLOBALS['phpmailer'] =
new PHPMailer();}}}. That will prevent wordpress to include the file
{{{/wp-includes/class-phpmailer.php}}}.
big thanks, I did some digging in wp_mail of {{{/wp-
includes/pluggable.php}}} and was able to figure out what to do.
I set the ticket to 'wontfix'
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14710#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list