简体   繁体   English

无法在实时服务器Laravel上使用Gmail smtp获取电子邮件

[英]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帐户访问安全性较低的应用:

  1. Go to your Google Account . 转到您的Google帐户
  2. On the left navigation panel, click Security. 在左侧导航面板上,单击安全性。
  3. 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. 如果您没有看到此设置,则您的管理员可能已关闭安全性较低的应用程序帐户访问权限。

Google不太安全的应用启用选项

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过 gmail Z787C75233B93AA5E45C3F85D130BFBEZ 服务器在 laravel 中发送 email - send email in laravel by gmail smtp server 使用 Gmail SMTP 和 Laravel 发送 email 时出错 - Error sending email using Gmail SMTP with Laravel 如何在实时服务器上的 Laravel 5.4 中发送电子邮件 Swift_TransportException 无法与主机 smtp.gmail.com 建立连接 - how to send email in laravel 5.4 on live server Swift_TransportException Connection could not be established with host smtp.gmail.com 使用 Laravel,SMTP 邮件在 Live Server 中不起作用 - Using Laravel, SMTP Mail not Working in Live Server 无法使用gmail smtp在laravel中发送电子邮件 - can't send email in laravel using gmail smtp 使用 smtp 服务器发送自定义 email 地址时出现 Laravel 错误 - Laravel error when sending custom email address using smtp server 我正在尝试使用 laravel 发送电子邮件,但出现此错误“stream_socket_client(): 无法连接到 tcp://smtp.gmail.com:587” - I am trying to send email using laravel and i am getting this error “stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587” 负载均衡的多个 laravel 应用服务器无法使用 smtp 和 ZDE01C1D48DB6C320C6374571 发送 email - Load balanced multiple laravel app servers can not send email using smtp with gmail 当用户在实时服务器中提交 laravel 中的联系表格时,从我的 gmail 帐户中的用户接收 email - Receive email from users in my gmail account when user submit the contact form in laravel in live server 当我在实时服务器上尝试全部操作时,Smtp Gmail无法正常工作 - Smtp Gmail Not Working As I tried All in live server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM