Is there no other text with the error message? Looking at the code, it should have some details as to what errors happened with each specific authentication method it tried.
Unfortunately, if it's working 99% of the time, then that would indicate that it's something on the SMTP server end that's triggering this issue (as this error only happens if they don't give a positive response when sent authentication details).
If you get the error, does it look like the same email is failing each time? The only thing you can go on from the error log is the address the email is sent to. If so, that might indicate something specific about the email that is causing problems (though I should note that this appears to be authentication related, so I think this is happening before the email content is actually sent over). If not, an error like this should normally cause the email to be queued internally and sending will be tried again a few times. It seems likely that a subsequent attempt works, which further points to some sort of temporary issue on the SMTP server.
Thanks for the reply. Here is the full message example below. This is on AWS SES and has worked great, but this error happens at least 1-5 times a day. It isn't the same email each day, it varies and is a range of different emails - yesterday there were like 10 from random emails. Any suggestions on how to resolve this? Thanks:
- Swift_TransportException: Email to muaaz.xxxxx@gmail.com failed: Failed to authenticate on SMTP server with username "xxxxxxxx" using 2 possible authenticators
- src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php:181
- Generated by: Unknown account
- May 13, 2021 at 12:47 AM
Stack trace
#0 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(332): Swift_Transport_Esmtp_AuthHandler->afterEhlo(Object(Swift_SmtpTransport))
#1 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(118): Swift_Transport_EsmtpTransport->_doHeloCommand()
#2 src/XF/Mail/Mailer.php(274): Swift_Transport_AbstractSmtpTransport->start()
#3 src/XF/Mail/Queue.php(138): XF\Mail\Mailer->send(Object(Swift_Message), Object(Swift_SmtpTransport), Array)
#4 src/XF/Job/MailQueue.php(12): XF\Mail\Queue->run(G)
#5 src/XF/Job/Manager.php(253): XF\Job\MailQueue->run(G)
#6 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#7 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#8 job.php(42): XF\Job\Manager->runQueue(false, 8)
#9 {main}
Request state
array(4) {
["url"] => string(8) "/job.php"
["referrer"] => string(77) "xxxxxxx"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}