I have a Gmail account since 2004.For years, I've been using my own e-mail client which fetches any new e-mails via IMAP and uses PHPMailer to talk to their SMTP server to send e-mails.
This has been working for a long time, although the account is locked from IMAP/SMTP from time to time, forcing me to log in to their web interface and answer "it was me".
This has happened again, but the usual answer does not work.
I'm able to log in to the web interface and clicked on "Allow insecure app access". Nothing indicates that my e-mail client is blocked but it just won't work. I can't fetch e-mails via IMAP and, when trying to send e-mails, I get the debug error:
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
With debug enabled, it logs:
535-5.7.8 Username and Password not accepted. Learn more at535 5.7.8 https://support.google.com/mail/?p=BadCredentialsSMTP ERROR: Password command failed: 535-5.7.8 Username and Password not accepted. Learn more at535 5.7.8 https://support.google.com/mail/?p=BadCredentialsSMTP Error: Could not authenticate.CLIENT -> SERVER: QUIT
I had not changed the password since this started happening and I wasn't able to find anything useful on that URL.
I've tried to change the password just to see if that would change anything, but the exact same error happens.
Sometimes when this happens, it wants me to log in and enter a CAPTCHA. It doesn't do this now.
I have certainly not changed anything in my system.PHPMailer is up to date, as is PHP.
I haven't found any comment or post about similar errors online.