We have encountered problems recently with some emails not being sent due to SMTP connect failures. Most emails are sent successfully. A sample log received recently follows:
[17-Nov-2023 17:28:34 America/New_York] Request URI: /index.php?main_page=checkout_process, IP address: xx.xxx.xxx.xx
#1 trigger_error() called at [domain/includes/functions/functions_email.php:393]
#2 zen_mail() called at [domain/includes/classes/order.php:1185]
#3 order->send_order_email() called at [domain/includes/modules/checkout_process.php:103]
#4 require(domain/includes/modules/checkout_process.php) called at [domain/includes/modules/pages/checkout_process/header_php.php:14]
#5 require(domain/includes/modules/pages/checkout_process/header_php.php) called at [domain/index.php:35]
--> PHP Notice: Email Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting<br /> in domain/includes/functions/functions_email.php on line 393.
After reading the github reference and cautions in the email troubleshooting documents in the developer docs section, would setting $do_debug to DEBUG_SERVER, and $Debugoutput to 'error_log' in includes/classes/vendors/PHPMailer/class.smtp.php obtain additional information to assist debugging this problem without displaying anything to the customers? How many myDEBUG logs will be generated per email sent?

We have had problems in the recent past with failed email authentication sent to gmail addresses. Apparently gmail randomly tests some emails sent to their addresses for proper authentication and rejects them if not properly authenticated. Our webmaster has worked with the webhost and made changes to the DNS to fix the authentication issues, so I suspect there may still be problems with DNS records. I do not know what changes were made to the DNS. The SMPT failure to connect errors occurred with gmail addresses.

So will activating SMTP logs as outlined above provide additional helpful information without displaying anything to the customer? Thank you!

Dave
zc1.5.7c, PHP 8.0.22, many plugins and custom code