Switching from Swiftmailer to Symfonymailer creating errors

youngkg7

New Member
Hi there, I've been using Mailwizz with swiftmailer just fine with all my settings, but when I change the default system mailer in Settings >> Common >> System Mailer >> Symfonymailer, I get an initial SSL error when sending a test email from the campaign settings.

Here's the initial error:

"Unable to send the test email to xxxxx@gmail.com! (Connection could not be established with host "ssl://smtp.gmail.com:587": stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number)"


I am using TLS with port 587 for my delivery servers and to fix this I changed it from TLS to SSL and used port 465 instead.

This fixes the SSL error, but I run into an authentication issue to my login, although the login details are correct and work when using swiftmailer.


Here's the auth error:

Unable to send the test email to xxxxx@gmail.com! (Failed to authenticate on SMTP server with username "xxxxxxx@gmail.com" using the following authenticators: "LOGIN", "PLAIN", "XOAUTH2". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535-5.7.8 Username and Password not accepted. For more information, go to 535 5.7.8 https://support.google.com/mail/?p=BadCredentials d2e1a72fcca58-71778598887sm398898b3a.159 - gsmtp".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535-5.7.8 Username and Password not accepted. For more information, go to 535 5.7.8 https://support.google.com/mail/?p=BadCredentials d2e1a72fcca58-71778598887sm398898b3a.159 - gsmtp".". Authenticator "XOAUTH2" returned "Expected response code "235" but got code "334", with message "334 eyJzdGF0dXMiOiI0MDAiLCJzY2hlbWVzIjoiQmVhcmVyIiwic2NvcGUiOiJodHRwczovL21haWwuZ29vZ2xlLmNvbS8ifQ==".".)

Not sure what to do from here because the credentials are correct.


Is this a bug with Symfonymailer?

Any help is appreciated!
 
Afaik for gmail, you'll need ssl on port 465, but looking at the error message, this seems related to the latest changes gmail did related to authentication.
So I am not sure how this can work with swiftmailer because the error message says totally otherwise.
The decoded error message says:
Code:
{"status":"400","schemes":"Bearer","scope":"https://mail.google.com/"}
So it's clear they expect you to connect using XOAUTH2 which we don't support, nor we plan to support it any time soon as we don't recommend using gmail and the such for bulk mailing.
If you're using php 7.4, you're safe using swiftmailer to continue having same behavior.
 
Back
Top