[英]Not Getting Email using Gmail smtp on live server Laravel
I am on Laravel 5.6 and my application working well. 我使用Laravel 5.6,并且我的应用程序运行良好。 I am using Gmail SMTP for mail services. 我正在使用Gmail SMTP进行邮件服务。
here is my .env file. 这是我的.env文件。
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=username@gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls
I have already Turned ON Less secure apps in Gmail also turned ON 2 step verification . 我已经打开了Gmail中不太安全的应用程序 ,也打开了两步验证 。
From localhost, the mail system working like charm and I am getting all emails from Gmail SMTP. 从本地主机,邮件系统像魅力一样工作,我正在从Gmail SMTP接收所有电子邮件。
But From Live Server, I am not getting any Emails and even there is no error popup. 但是从Live Server,我没有收到任何电子邮件,甚至没有错误弹出窗口。
My Host is a 000webhost free account because I am testing my Application. 我的主机是一个000webhost免费帐户,因为我正在测试我的应用程序。
so I read forums in 000webhost and change "SET MX RECORD " to "GOOGLE'S MX RECORD". 因此,我在000webhost中阅读了论坛,并将“ SET MX RECORD”更改为“ GOOGLE'S MX RECORD”。
Now I am getting this error while sending any mail. 现在,我在发送任何邮件时都收到此错误。
Expected response code 250 but got code "530", with message "530-5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/?p=WantAuthError k142sm4568022ywa.67 - gsmtp " 预期的响应代码为250,但代码为“ 530”,消息为“ 530-5.5.1要求身份验证。有关详细信息, 请参阅530 5.5.1 https://support.google.com/mail/?p=WantAuthError k142sm4568022ywa.67-gsmtp “
Please help! 请帮忙! Thanks in advance. 提前致谢。
try changing your config/mail.php
to your current credentials: 尝试将config/mail.php
为当前凭据:
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME', 'username@gmail.com'),
'password' => env('MAIL_PASSWORD', 'password'),
Please allow access to less secure app from your google account following these steps: 请按照以下步骤操作,从您的Google帐户访问安全性较低的应用:
- Go to your Google Account . 转到您的Google帐户 。
- On the left navigation panel, click Security. 在左侧导航面板上,单击安全性。
- On the bottom of the page, in the Less secure app access panel, click Turn on access. 在页面底部的“不太安全的应用程序访问”面板中,单击“打开访问权限”。
If you don't see this setting, your administrator might have turned off less secure app account access. 如果您没有看到此设置,则您的管理员可能已关闭安全性较低的应用程序帐户访问权限。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.