• Every time some one tries to post a comment on my blog this error gets displayed.

    Fatal error: Cannot redeclare class PHPMailer in D:\Domains\nickibrochner.com\wwwroot\wp-includes\class-phpmailer.php on line 21

    I can deduct that is has something to do with sending me an email with a notification about that there is a comment awaiting me. But how do I solve this Fatal Error ?? 😉

    .Nicki

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

    (@w1m)

    I’m having the same problem with WP 2.5. The problem is actually in pluggable.php at the start of function wp_mail, about line 265. Somehow the checks for phpmailer’s prior existence are saying it’s not there when it really is. I’m awaiting a call from support on how to proceed or if it’s a configuration issue on the server.

    w1m

    (@w1m)

    The PHPMailer class is already defined, but WP 2.5 doesn’t check before redeclaring it if the $phpmailer object doesn’t exist. To fix this, go into /wp-includes/pluggable.php. Go down to line 267 which should look like this:

    require_once ABSPATH . WPINC . ‘/class-phpmailer.php’;

    Change it to this:

    if ( !class_exists(“PHPMailer”) ) require_once ABSPATH . WPINC . ‘/class-phpmailer.php’;

    That should take care of it. Or, if you know your host won’t be changing anything, simply comment out line 267.

    Hi,

    This problem is similar to mine but the solution doesnt work for me:

    After an upgrade to 2.6 no emails are send after comments posts or backups. The sending of emails does not fail, they are simply not send. My eventviewer doesn’t log any action to send an email after a comment is posted or when a backup is made.
    When i try to send myself an email with (lost password function) is get the folowwing errormessage: Fatal error: Cannot redeclare class PHPMailer in …./wp-includes/class-phpmailer.php on line 1517

    Anyone has a clue?

    Problem is solved: It seemed that my class-phpmailer.php was corrupt, downloaded it again end extracted it from the rar file and uploaded it my include directory

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fatal error: Cannot redeclare class PHPMailer’ is closed to new replies.