Title: PHP Warning: Cannot declare class PHPMailer, phpmailerException
Last modified: August 1, 2025

---

# PHP Warning: Cannot declare class PHPMailer, phpmailerException

 *  Resolved [efintina](https://wordpress.org/support/users/efintina/)
 * (@efintina)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/php-warning-cannot-declare-class-phpmailer-phpmailerexception/)
 * In the error_log I have entries like this:
 * [01-Aug-2025 03:41:40 UTC] PHP Warning: Cannot declare class PHPMailer, because
   the name is already in use in/wp-content/plugins/post-smtp/Postman/Phpmailer/
   PostsmtpMailer.php on line 24
   [01-Aug-2025 03:41:40 UTC] PHP Warning: Cannot 
   declare class phpmailerException, because the name is already in use in /wp-content/
   plugins/post-smtp/Postman/Phpmailer/PostsmtpMailer.php on line 26

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [M Aqib Khan](https://wordpress.org/support/users/aqibkhan9/)
 * (@aqibkhan9)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/php-warning-cannot-declare-class-phpmailer-phpmailerexception/#post-18581027)
 * Hello @efintina ,
 * We hope this message finds you well.
 * Thank you for reaching out to our Support team. We’re truly sorry to hear that
   you’ve encountered this issue, this is certainly not the experience we aim to
   provide.
 * I’ve forwarded the details to our technical team for further analysis. I will
   get back to you as soon as I receive their response or if we require any additional
   information from your end. In the meantime, kindly share the **Diagnostic test
   report** from Post SMTP Dashboard.
 * We truly appreciate your patience and cooperation throughout this process. If
   you have any questions or concerns in the meantime, please don’t hesitate to 
   reach out.
 * Warm regards,
   Support Team – WP Experts
 *  Plugin Support [M Aqib Khan](https://wordpress.org/support/users/aqibkhan9/)
 * (@aqibkhan9)
 * [9 months, 3 weeks ago](https://wordpress.org/support/topic/php-warning-cannot-declare-class-phpmailer-phpmailerexception/#post-18599881)
 * Hello @efintina ,
 * I appreciate your patience and cooperation as we worked to resolve the issue.
 * I’m pleased to inform you that our technical team has successfully addressed 
   the problem.
 * Kindly download and install the provided beta version, and let us know your feedback
   once you’ve had a chance to test it. Your input is valuable to us.
 * [Download Beta](https://drive.google.com/file/d/1E5e7QP7wdyIagDc57wrp4ayiV_DnmW-X/view?usp=sharing)
 * Looking forward to hearing from you!
 * Warm regards,
   Support Team – WP Experts
 *  Plugin Support [M Aqib Khan](https://wordpress.org/support/users/aqibkhan9/)
 * (@aqibkhan9)
 * [9 months, 3 weeks ago](https://wordpress.org/support/topic/php-warning-cannot-declare-class-phpmailer-phpmailerexception/#post-18604458)
 * Hello @efintina ,
 * We hope you are doing well.
 * We are marking this thread as resolved due to inactivity. If you encounter any
   further issues, please feel free to open a new thread.
 * Have a great day!
 * Thanks and regards,
   Support Team – WP Experts

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP Warning: Cannot declare class PHPMailer, phpmailerException’ is closed
to new replies.

 * ![](https://ps.w.org/post-smtp/assets/icon-128x128.gif?rev=3209655)
 * [Post SMTP – Complete Email Deliverability and SMTP Solution with Email Logs, Alerts, Backup SMTP & Mobile App](https://wordpress.org/plugins/post-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/post-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-smtp/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [M Aqib Khan](https://wordpress.org/support/users/aqibkhan9/)
 * Last activity: [9 months, 3 weeks ago](https://wordpress.org/support/topic/php-warning-cannot-declare-class-phpmailer-phpmailerexception/#post-18604458)
 * Status: resolved