Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Beta 1 and 2 are fine, but after updating to Beta 3, emails won't send anymore with Can't connect to server errors. Sample debug info attached
Comment | File | Size | Author |
---|---|---|---|
#6 | phpmailer.class_.inc_.rej_.txt | 875 bytes | Proteo |
#5 | phpmailer-implement_smtp_authentication_type-2898845-5.patch | 2.53 KB | oadaeh |
| |||
debug message.txt | 5.47 KB | kruser |
Comments
Comment #2
oadaeh CreditAttribution: oadaeh at Hook 42 commentedSorry for not responding sooner.
I don't know if this is still a problem, but here are my observations:
Let me know if this is still a problem for you or not, and if so, please try to provide the actual message in plain text, so that I can see what it says.
Thank you.
Comment #3
Proteo CreditAttribution: Proteo as a volunteer commentedHi there. Sorry for hijacking this issue, I'm having a similar problem and even if after reading the debug messages in the above post I realize the source of the issue I'm facing is not exactly the same, I wanted to share my findings.
I'm having an "SMTP Authentication failed" message every single time I try to send emails, when obviously all the SMTP settings (including username and password) are correct. After checking the debug messages, there's always an error
SMTP ERROR Username command failed: 535 5.7.8
at the end of the logs.A quick search revealed a possible solution here and here, by adding
$mail->AuthType = 'LOGIN';
when configuring the PHPMailer class.So I did a quick test adding
$this->AuthType = 'LOGIN';
to the line #76 in phpmailer/includes/phpmailer.class.inc and voilà, everything is now working flawlessly.From what I read in the linked posts, it seems necessary to set the AuthType property whe using versions >= 5.2.25 of the PHPMailer library, so you may want to take a look at it.
Comment #4
oadaeh CreditAttribution: oadaeh at Hook 42 commentedThank you for the information @Proteo. It is curious to me why that was not included already, but it may be because the PHPMailer library does a descent job of guessing it, that it wasn't needed for most situations.
Comment #5
oadaeh CreditAttribution: oadaeh at Hook 42 commentedAttached is a patch that addresses the issue.
@Proteo, if you can test it and let me know if it still works for you, that would be great.
Comment #6
Proteo CreditAttribution: Proteo as a volunteer commentedHi @oadaeh, unfortunately the patch won't apply cleanly to 7.x-3.0-beta4:I'm attaching the phpmailer.class.inc.rej file. Many thanks for your support, please let me know if I can help further.Sorry, my bad! It's too early in the morning :) I was trying to apply your patch over my modified version :| After cleaning up my own changes, the patch worked perfectly. And after choosing "LOGIN" as authentication type in the new options select I can send emails without problem.
Comment #7
Proteo CreditAttribution: Proteo as a volunteer commentedComment #9
oadaeh CreditAttribution: oadaeh at Hook 42 commentedThis has been committed to the dev branch. I will be committing #2947486: Clean up code and then creating 7.x-3.0-rc1.