I have configured symfony to send emails using gmail:
// .env file
MAILER_URL=gmail://<email>:<password>@localhost?encryption=tls&auth_mode=oauth
When I run ./bin/console swiftmailer:email:send on my local dev machine the email is sent out.
I have the same setting on a staging server and when I run ./bin/console swiftmailer:email:send on this machine I get an error
Exception occurred while flushing email queue: Failed to authenticate on SMTP server with username "username" using 1 possible authenticators
I have turned on access for less secure apps in gmail.
I don't understand why it would authenticate on my local machine and not the staging server.