通过RoundCube进行Laravel的邮件配置 [英] Mail config for Laravel over RoundCube

查看:74
本文介绍了通过RoundCube进行Laravel的邮件配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Laravel从RoundCube发送一些电子邮件.问题是我总是遇到同样的错误

I am using Laravel to send out some emails from RoundCube. The trouble is that I keep getting the same error

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 文件中与手头问题有关的一部分.

I have looked around and havent found an accurate answer for that. Here is a part of the .env file that is relevant to the problem at hand.

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}"

我尝试分别用 tls 587 替换 MAIL_ENCRYPTION MAIL_PORT .另外,我确保凭据确实有效.我还查看了ovh文档,这些文档对发送邮件毫无帮助.另外,没有选项可以允许安全性较低的帐户(例如Gmail).

I tried to replace the MAIL_ENCRYPTION and MAIL_PORT with tls and 587 respectively. Also, I made sure that the credentials actually work. I also looked at the ovh docs which were not helpful at all for sending mails. Also, there is no option to allow less secure accounts like in Gmail.

谢谢

推荐答案

首先从用MAIL_声明的.env文件中删除所有邮件配置.

First remove all mail configuration from .env file stated with MAIL_

然后从config文件夹中打开mail.php,并在smtp下创建一个新数组.

Then open your mail.php from config folder and create a new array under smtp.

'gmail' => [
        'transport' => 'smtp',
        'host' => 'smtp.gmail.com',
        'port' => 465,
        'encryption' => 'ssl',
        'username' => 'aravvi@gmail.com',
        'password' => 'xxigefvqehfypdmg',
    ],

然后在您的默认邮件中提及它

then mention it in your default mailer

'default' => env('MAIL_MAILER', 'gmail'),

运行这些命令

php artisan config:clear

compser dump-autoload

然后

php artisan serve

希望可以解决您的问题.

hope will solve your problem.

这篇关于通过RoundCube进行Laravel的邮件配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆