У меня есть код для использования следующего в файле среды:
GOOGLE_EMAIL=email@domain.com
GOOGLE_PASSWORD='xxxx xxxx xxxx xxxx'
И PHP-код следующим образом — с использованием Swift_Mailer
// Create the Transport$transport = (new Swift_SmtpTransport('smtp.gmail.com', 465, 'ssl'))->setUsername($_ENV['GOOGLE_EMAIL'])->setPassword($_ENV['GOOGLE_PASSWORD']);
Но вдруг сегодня я получаю следующее:
Failed to authenticate on SMTP server with username "email@domain.com" using 3 possible authenticators.
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 xxx-xxx.17 - 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 xxx-xxx.17 - gsmtp ".
Authenticator XOAUTH2 returned Expected response code 250 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 xxx-xxx.17 - gsmtp ".
Подробнее здесь: https://stackoverflow.com/questions/798 ... thenticate