• Resolved SiteBolts

    (@sitebolts)


    When submitting a contact form message on our site, Fluent SMTP throws this critical error:

    [02-Dec-2025 10:03:34 UTC] PHP Fatal error:  Uncaught Error: Class "PDO" not found in /home/our-site/wp-content/plugins/fluent-smtp/app/Services/DB/QueryBuilder/QueryBuilderHandler.php:49
    Stack trace:
    #0 /home/our-site/wp-content/plugins/fluent-smtp/app/Services/DB/wpfluent.php(17): [constant expression]()
    #1 /home/our-site/wp-content/plugins/fluent-smtp/app/Functions/helpers.php(852): FluentSmtpDb()
    #2 /home/our-site/wp-content/plugins/fluent-smtp/app/Models/Model.php(28): fluentMailDb()
    #3 /home/our-site/wp-content/plugins/fluent-smtp/app/Models/Logger.php(232): FluentMail\App\Models\Model->getDb()
    #4 /home/our-site/wp-content/plugins/fluent-smtp/app/Services/Mailer/BaseHandler.php(322): FluentMail\App\Models\Logger->add()
    #5 /home/our-site/wp-content/plugins/fluent-smtp/app/Services/Mailer/Providers/DefaultMail/Handler.php(36): FluentMail\App\Services\Mailer\BaseHandler->processResponse()
    #6 /home/our-site/wp-content/plugins/fluent-smtp/app/Services/Mailer/Providers/DefaultMail/Handler.php(23): FluentMail\App\Services\Mailer\Providers\DefaultMail\Handler->handleSuccess()
    #7 /home/our-site/wp-content/plugins/fluent-smtp/app/Services/Mailer/Providers/DefaultMail/Handler.php(13): FluentMail\App\Services\Mailer\Providers\DefaultMail\Handler->postSend()
    #8 /home/our-site/wp-content/plugins/fluent-smtp/app/Services/Mailer/FluentPHPMailer.php(28): FluentMail\App\Services\Mailer\Providers\DefaultMail\Handler->send()
    #9 /home/our-site/wp-content/plugins/fluent-smtp/app/Functions/helpers.php(613): FluentMail\App\Services\Mailer\FluentPHPMailer->send()
    #10 /home/our-site/wp-content/plugins/fluent-smtp/fluent-smtp.php(49): fluentMailSend()
    #11 /home/our-site/wp-content/plugins/elementor-pro/modules/forms/actions/email.php(364): wp_mail()
    #12 /home/our-site/wp-content/plugins/elementor-pro/modules/forms/classes/ajax-handler.php(159): ElementorPro\Modules\Forms\Actions\Email->run()
    #13 /home/our-site/wp-includes/class-wp-hook.php(324): ElementorPro\Modules\Forms\Classes\Ajax_Handler->ajax_send_form()
    #14 /home/our-site/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #15 /home/our-site/wp-includes/plugin.php(517): WP_Hook->do_action()
    #16 /home/our-site/wp-admin/admin-ajax.php(207): do_action()
    #17 {main}
    thrown in /home/our-site/wp-content/plugins/fluent-smtp/app/Services/DB/QueryBuilder/QueryBuilderHandler.php on line 49

    We have PDO disabled for security/performance reasons and don’t need to enable it; even with the fatal error above, the email still gets sent out successfully. However, FluentSMTP is breaking the form’s AJAX response after sending out the email.

    Steps to reproduce:
    1. Install Fluent SMTP and set it to use the default PHP mailer.
    2. Add a form to the site, like an Elementor form.
    3. Disable PDO on the server.
    4. Attempt to submit the form; the form submission will be successful and the email will be sent out, but Fluent SMTP will throw a fatal error afterwards, breaking the AJAX response and resulting in the plugin not logging the email.

    It looks like a similar issue was raised here back in March and that some kind of partial fix was made to the plugin back then, but it’s still not handling this situation correctly. In the situation above, the plugin needs to check whether PDO is enabled and work around it to prevent the fatal error while ideally still logging the email.

    If PDO is truly essential here (which doesn’t look to be the case, since the email still gets sent out), then the plugin should at least check for this ahead of time and warn the admin that it needs to be enabled, such as with a notification on the wp-admin dashboard.

Viewing 1 replies (of 1 total)
  • Plugin Support Ibrahim Sharif

    (@ibrahimsharif)

    Hello @sitebolts,

    I appreciate your approach to server security and performance by disabling unnecessary extensions. However, I must gently clarify that the PDO extension is indeed an essential component for FluentSMTP. Our plugin leverages PDO (PHP Data Objects) for its robust internal database operations. These operations are crucial for a range of features beyond just sending emails, including:

    • Comprehensive Email Logging: FluentSMTP uses its internal database to meticulously log every email sent, tracking its status, recipient, and other vital details.
    • Advanced Features: Many of FluentSMTP’s advanced functionalities, such as detailed analytics, email retries, and other internal data management tasks, rely on a stable database connection that PDO facilitates.

    The fatal error occurs because, while the initial part of the email sending process might complete, FluentSMTP then attempts to record this activity and manage its internal data using its database handler, which explicitly requires the PDO extension. When PDO is unavailable, this critical step fails with the “Class ‘PDO’ not found” error. This abrupt termination of the script is what consequently breaks the AJAX response for your form and prevents the email from being logged.

    Therefore, for the complete and seamless operation of FluentSMTP, including its logging capabilities and ensuring no conflicts with your site’s AJAX functionalities, it is essential to have the PDO extension enabled on your server.

    The immediate solution to fully resolve this fatal error and restore all FluentSMTP functionalities (including proper email logging and a smooth AJAX response for your forms) is to enable the PDO extension. This is typically done through your hosting provider’s control panel or by contacting their support team to enable the appropriate php-pdo extension for your PHP version.

    I also want to assure you that your suggestion about implementing a proactive check for PDO availability and displaying a clear warning in the WordPress admin dashboard is excellent and valuable feedback. We completely understand the importance of providing upfront information regarding plugin dependencies, and I have already passed this suggestion along to our development team for their consideration in future updates.

    Please let us know once the PDO extension has been enabled on your server, and we will be more than happy to assist further if any other questions or issues arise.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.