• Resolved wfn

    (@wfn)


    FYI – After updating WordPress to 4.3 and AWPCP to Version 3.5.3.1 I am receiving this error whenever AWPCP attempts to send an email:

    Fatal error: Cannot redeclare class SMTP in /home/content/x/y/html/wp-includes/class-smtp.php on line 28

    This appears to be a conflict with the SendGrid plugin which was updated to Version 1.6.1 at the same time as AWPCP. No errors are generated so far from other plugins/WordPress sending email via SendGrid only AWCP. Since SendGrid provides the transport and gateway for all of our outbound mail from WordPress it cannot be disabled.

    From my understanding this seems to be some sort of namespace collision between the two plugins. Can you please look into to this to determine the issue and see if there is a quick fix.

    FYI – I will post this in the SendGrid plugin support area as well.

    Thanks!

    https://ww.wp.xz.cn/plugins/another-wordpress-classifieds-plugin/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi wfn,

    I believe you are correct–that looks like something we’ll have to adjust. I’ll note this to my developer and have him look at it ASAP.

    Hi wfn,

    After some further investigation–we’re only using the standard WP class for SMTP mailer, so there’s really nothing we can adjust on our side. This is definitely an issue with SendGrid’s name spacing, and they’ll have to correct it. My developer’s comments are here:

    The SendGrid plugin (v1.6.1) has a Smtp class defined in sendgrid-email-delivery-simplified/lib/class-sendgrid-smtp.php. That’s the class causing the Fatal error.

    We use phpmailer to encode the name used in email address. To do that, AWPCP may create an instance of phpmailer if one is not already available. In order to create that instance, we have to include WordPress class-phpmailer.php and class-smtp.php.

    I imagine that normally a phpmailer instance is not created when the SendGrid plugin is installed and that’s why didn’t noticed the problem before. However, this issue is SendGrid’s responsibility because they have a class in their code that shares its name with one of the class included in WordPress’ core.

    That error was already reported by another user here: https://ww.wp.xz.cn/support/topic/class-name-conflict-smtp-and-smtp.

    Thread Starter wfn

    (@wfn)

    Thanks for the quick response!
    I have posted your comments to the SendGrid support forum post reference above.

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

The topic ‘Fatal error: Cannot redeclare class SMTP’ is closed to new replies.