Declaration error in phpmailerException class

Asked

Viewed 308 times

0

I use wordpress, and am using the plugin contact form 7. When sending an email by clicking the button, it returns me the following error:

Fatal error: Cannot declare class phpmailerException, because the name is already in use in /home/Storage/d/94/6a/renovedigital/public_html/wp-includes/class-phpmailer.php on line 4040

Going down that line I found the following code:

4025 /**
4026  * PHPMailer exception handler
4027  * @package PHPMailer
4028  */
4029 class phpmailerException extends Exception
4030 {
4031     /**
4032      * Prettify error message output
4033      * @return string
4034      */
4035     public function errorMessage()
4036     {
4037         $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n";
4038         return $errorMsg;
4039     }
4040 }
  • 1

    He is complaining that this class is already declared and cannot redeclare. You are redeclareting this class somewhere in your code?

  • 1

    If you’re using include swap for include_once.

  • Thank you William, solved!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.