Gmail setup stopped working after the update
I had a setup for the gmail smtp, like so:
debug: true
mailer:
engine: smtp
smtp:
server: smtp.gmail.com
port: 587
user: '[email protected]'
password: 'xxxx xxxx xxxx xxxx'
It was working fine for my both sites (I have a multisite setup) until the most recent update to 4.1.0. version. Now, it is logging this error:
"Failed to authenticate on SMTP server with username "[email protected]" 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 a640c23a62f3a-a6c805c59a2sm133747166b.50 - 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 a640c23a62f3a-a6c805c59a2sm133747166b.50 - gsmtp".". Authenticator "XOAUTH2" returned "Expected response code "235" but got code "334", with message "334 eyJzdGF0dXMiOiI0MDAiLCJzY2hlbWVzIjoiQmVhcmVyIiwic2NvcGUiOiJodHRwczovL21haWwuZ29vZ2xlLmNvbS8ifQ==".". [] []"
I have tested the same credentials with phpMailer in a separate script, and it works no problem. This plugin (for me, at least) only works with Outlook currently, but not with Gmail.
What version did you update from?
The previous one 4.0.4. I also tried sending email with Gmail using CLI test command. Same situation.
I get this same error trying to utilize gmail. Not sure if I've ever had it working as it's been a while but the setup seems simple enough, and save's fine, but get this.
edit: version 4.1.1
Did you see this note in the README:
As Gmail no longer supports the "allow less secure apps" option, you now need to have 2FA enabled on the account and setup an "App Password" to create a specific password rather than your general account password. Follow these instructions: https://support.google.com/accounts/answer/185833
Are you using an App password?
FYI, I just tested this with an app password and it worked fine. I had to set my 'from address' to the same google account I was using to login with, and also Google gave me an app password like this: pxzl vkxd xdap fomb, with spaces, and it kept the spaces when i copied and pasted it. However, I had to remove the spaces manualy so the pasword was pxzlvkxdxdapfomb. Yet another bad UI design descision on Google's part, the spaces are so you can read it better, but they are just visual cues.
Yes, I have been using an app password via 2 factor authentication settings.
Hey! The spaces were the key. I would have never expected to have to modify the password they gave me. I do see your note now in the docs (not sure if I initially missed it of if you added it). When I first tried removing the spaces I pasted into another field and cleared them out, but also managed to get an extra space at the end which obviously failed. Long story short, double triple check the app password is just the characters from google and no extra spaces!
Thanks for your time on this.
Merci pour l'astuce @rhukster j'étais bloqué à cause de Google :) Thanks for the tip @rhukster I was stuck because of Google :)