I continue to have problems sending emails with the SMTP Authentication Support module in my Drupal 10.2.4 site with php 8.2.17 that's hosted on a GoDaddy.com Virtual Private Server.
The system log shows that e-mails are being sent,
Mail sent to ulandreman@gmail.com with subject Drupal SMTP test e-mail:
To: ulandreman@gmail.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: 8Bit X-Mailer: Drupal Return-Path: <info@landreman.com> Sender: info@landreman.com From: Landreman family <info@landreman.com> Subject: Drupal SMTP test e-mail If you receive this message it means your site is capable of using SMTP to send e-mail. but the intended recipients never receive them.
Working with the tech staff at GoDaddy, we've shown that the email system works on the server. However, no messages sent from the Drupal site ever appear in the relay information on the server.
The problem seems to be somewhere in the interface between Drupal and the server.
One clue that things are amiss is that when I'm on Configuration page of the SMTP Authentication Support and I send a test e-mail with the Enable debugging box checked, I do NOT see the list of messages flash on the screen. I've seen this with other Drupal sites, so I know what should be appearing.
I don't know enough of the inner-workings of Drupal's mail infrastructure to know what might be causing the trouble.
What file (X.php?) does the actual display of the Enable debugging information?
Is the information that "should" be displaying stored in some log file somewhere? If so, which one?
Where should I put some display statements to track how far the system gets after logging the "Mail sent to ..." message before it stops?
Thanks for any help.
Comments
Checking PHP Configuration:
Checking PHP Configuration:
php.ini) allows for error logging (log_errors = On) and specifies an error log file (error_log = /path/to/php-error.log).mail()function is not disabled (disable_functionsdirective inphp.ini) as some modules might fall back to using it under certain configurations.Drupal & Server Mail Configuration:
What File Handles Debugging Display?: The SMTP module's debugging output is generated by the module itself. Look into the SMTP module's directory, particularly for files like
smtp.mail.incor similarly named ones that handle mail sending functionality. Debugging output is typically handled through these scripts, especially in functions that deal with sending or testing emails.Where to Add Custom Debug Statements:
error_logstatements in the SMTP module, particularly around the sections where emails are being sent or where debugging information is generated.Suggestions
Thanks for the note and your suggestions.
I'll check them out to see if they help solve this mystery.
On the trail
So, I see in the module vendor/phpmailer/phpmailer/src/SMTP.php, the program is putting out messages, such as
$this->edebug(
"Connection: opening to $host:$port, timeout=$timeout, options=" .
(count($options) > 0 ? var_export($options, true) : 'array()'),
self::DEBUG_CONNECTION
);
that appear on the list of messages from the STMP session that flashes quickly on the screen when you are in the Configuration/SMTP Authentication Support page and you click on Enable Debugging and send a test email - at least it does that when things work.
Where is the log file that those messages get stored?
I don't see them in the admin/reports/recent log messages log.
I don't see them if I go to the Drupal database and look at the watchdog table.
I assume that they're written out somewhere. I just haven't been able to find that file to troubleshoot effectively.
Can you point me in the right direction?
Uninstalling Helper was the key
I'm still unclear what was causing the mail messages not to be delivered, but I uninstalled the helper module and then suddenly things started working.
The phrase our team used decades ago was "It's another mystery of data processing".
Regardless, the mail is going through, so all is good with the world.
Exact same question. Did you
Exact same question. Did you figure this out or where the verbose gets printed/stored? Flashing on the screen for 1 second doesn't seem like the intended functionality. I'm on Pantheon.
Up, up, and away
No. I never did figure out where all the messages go.
I just adjusted and re-adjusted the parameters until it started working.
Sorry.
It does not go anywhere
It does not go anywhere because debug print function is not implemented by SMTP module authors
web/modules/contrib/smtp/src/Plugin/Mail/SMTPMailSystem.php
// Turn on debugging, if requested.
if ($this->smtpConfig->get('smtp_debugging')
&& $this->currentUser->hasPermission('administer smtp module')) {
$mailer->Debugoutput = function($str, $level) {
// drupal set message $str
};
$mailer->SMTPDebug = TRUE;
}
Look at html page source
Looks like all debug info is before the doctype html tag...
...