I have been working with WPForms on this but they insist the issue is not on their side.
I am using the plugin WP SMTP to allow WordPress to send SMTP email. This changes the wp_mail() function to use SMTP mail.
This work fine in all other areas on my WordPress site. However, in toolset when I setup an email from a post form and send a test email I get:
AJAX Request failed!
Response Code: 500
Response Message:
There has been a critical error on your website.
Can you turn on server logs so I can get more information about the error? If you're not familiar with server logs I can show you how to activate one temporarily: Go in your wp-config.php file and look for
define('WP_DEBUG', false);
Change it to:
define('WP_DEBUG', true);
Then add these lines, just after the WP_DEBUG line:
define('WP_DEBUG_LOG', dirname(__FILE__) . '/error_log.txt');
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
define('WP_DISABLE_FATAL_ERROR_HANDLER',true);
Run the test once again. If any server-side errors are triggered during this process, it will create an error_log.txt file in your site's root directory. Use FTP to look for this file in the same directory as wp-config.php. You may need to click "Refresh" in your FTP browser to see a new file appear. Please download this file to your computer, open it in any text editing software, and send me its contents. Once that is done, you can revert the changes you made to wp-config.php and delete the log file using FTP.
This is the error message.
[30-Aug-2020 20:17:21 UTC] PHP Fatal error: Cannot declare class PHPMailer\PHPMailer\SMTP, because the name is already in use in /home/dragonslist/public_html/wp-includes/PHPMailer/SMTP.php on line 30
Okay thank you. Can you confirm that this issue occurs when only Toolset plugins and the SMTP plugin are active with a default theme, like Twenty Twenty, active? This will help us rule out a conflict with some other third-party plugin like WP Forms.
I have tested removing all other plugins but not changing the theme.
I will disable all plugins, change the theme, and test now
I have verified he issue still occurs with the default theme and only the plugins Toolset Types, Toolset Forms, and WP Mail SMTP
OK thank you for the additional information. I'd like to run a test on my local environment to see if I can replicate the error you mentioned. Can you tell me more about your WP Mail SMTP setup so I can replicate your configurations?
- Go to WP Mail SMTP > Settings
- What is the From Email?
- Is "Force from email" checked?
- What is the From Name?
- Is "Force from name" checked?
- Which mailer system is selected?
- How are you sending a test email - from the WP Mail SMTP Email Test feature, or from the Toolset Forms Send Test Email feature?
I have activated private reply fields here for security. You can add fake information if necessary to submit your reply.
Thanks, can you tell me who your SMTP provider is? I'm not sure how to go about testing this without an SMTP account set up, so I'm asking my team for some additional advice.
Also I'm seeing a similar error reported here for the WP Mail SMTP plugin:
https://wordpress.org/support/topic/php-fatal-error-cannot-declare-class-phpmailerphpmailersmtp/
Maybe it's an issue in the SMTP plugin itself. Is it possible to try a different SMTP plugin?
I will try another plugin and see. Thank you for that.
Also, I use AWS SES from Amazon for SMTP
Thanks, I'll stand by for your update.
Using a different SMTP plugin solved the issue.
I should have known that toolset was written better than wpforms.
My interaction with their support team led me to believe the issue was with toolset however it was not.
Thank you for such great support and such a great product.
Which other SMTP plugin solved this issue?
Hi @larryL, unfortunately I'm not aware which plugin he implemented to replace the WP Mail SMTP plugin. Ticket authors do not always see updates about comments in resolved tickets. @chrisH-34, if you read this message, would you mind sharing information about the SMTP plugin you ended up using? If you have a link to the WordPress.org plugin landing page I'm sure other Toolset Users would appreciate knowing which SMTP plugin you found to be acceptable.
Best regards,
Christian C
I went with Easy WP SMTP and did not have any issues.