我正在使用Laravel发送一些来自RoundCube的电子邮件。问题是我总是犯同样的错误
Failed to authenticate on SMTP server with username "user@email.com" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 250 but got code "530", with message "530 5.7.1 Client was not authenticated
". Authenticator PLAIN returned Expected response code 250 but got code "530", with message "530 5.7.1 Client was not authenticated.
我环顾四周,没有找到准确的答案。下面是与当前问题相关的.env文件的一部分。
MAIL_DRIVER=smtp
MAIL_HOST=ssl0.ovh.net
MAIL_PORT=465
MAIL_USERNAME=user@email.com
MAIL_PASSWORD=somepassword
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
我试图将MAIL_ENCRYPTION
和MAIL_PORT
分别替换为tls
和587
。此外,我还确保了凭证的实际工作。我还查看了ovh文档,这些文档对发送邮件毫无帮助。此外,也没有任何选项允许不太安全的帐户,如在Gmail。
谢谢
发布于 2020-11-11 08:48:54
首先,从.env文件中删除使用MAIL_声明的所有邮件配置
然后从配置文件夹中打开mail.php,并在smtp下创建一个新数组。
'gmail' => [
'transport' => 'smtp',
'host' => 'smtp.gmail.com',
'port' => 465,
'encryption' => 'ssl',
'username' => 'aravvi@gmail.com',
'password' => 'xxigefvqehfypdmg',
],
然后在默认的邮件程序中提到它。
'default' => env('MAIL_MAILER', 'gmail'),
运行这些逗号
php artisan config:clear
和
compser dump-autoload
然后
php artisan serve
希望能解决你的问题。
https://stackoverflow.com/questions/64777498
复制相似问题