Laravel与Gmail发送电子邮件 - 在2022年6月的安全应用程序选项(不再支持)之后

发布于 2025-02-07 12:35:37 字数 609 浏览 2 评论 0原文

几天前,Gmail Change是有关该选项的政策 “不太安全的应用程序&您的Google帐户” 此设置不再可用,

我的Laravel应用程序已停止发送电子邮件,

MAIL_MAILER=smtp
#MAIL_HOST=smtp.gmail.com
#MAIL_PORT=465
#[email protected]
#MAIL_PASSWORD= *********
#MAIL_ENCRYPTION= ssl
#[email protected]
#MAIL_FROM_NAME=""`

请帮助

Few days ago gmail change is policy regarding the option
"Less secure apps & your Google Account"
This setting is no longer available

My Laravel app is stopped sending email

MAIL_MAILER=smtp
#MAIL_HOST=smtp.gmail.com
#MAIL_PORT=465
#[email protected]
#MAIL_PASSWORD= *********
#MAIL_ENCRYPTION= ssl
#[email protected]
#MAIL_FROM_NAME=""`

Please help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冰雪梦之恋 2025-02-14 12:35:37

是的,在删除Google选项后,它无法正常工作。但是没什么可担心的!发送电子邮件仍然非常简单。要再次发送电子邮件,您需要以Bellow的形式执行此操作:

  1. 登录到您的Gmail帐户,例如MyAccount.google.com AFAIK
  2. 转到安全设置,并
  3. 在启用此功能后启用2个因子(步骤)身份验证,您可以看到应用程序密码选项。单击在这里
  4. 然后,从您的应用程序密码选项卡中选择其他选项,然后放置您的应用程序名称,然后单击“生成”按钮以获取新的应用程序密码。
  5. 最后,复制密码的16位数字,然后单击完成。现在,使用此密码而不是电子邮件密码通过您的应用发送邮件。

现在,您可以仅使用电子邮件,然后生成的通过来发送电子邮件。

来自 https://stackoverflow.com/a/a/72626684/533426

yes, It's not working after removing the option by google. But nothing to worry! It's still very simple to send email. To send email again you need to do this as bellow:

  1. Login to your gmail account e.g. myaccount.google.com afaik
  2. Go to Security setting and Enable 2 factor (step) authentication
  3. After enabling this you can see app passwords option. Click here!
  4. And then, from Your app passwords tab select Other option and put your app name and click GENERATE button to get new app password.
  5. Finally copy the 16 digit of password and click done. Now use this password instead of email password to send mail via your app.

Now you can use just email and this generated pass to send email.

from https://stackoverflow.com/a/72626684/533426

忘羡 2025-02-14 12:35:37

不太安全的应用程序( https://myaccount.google.com/u/0/0/ )选项已被Google禁用。

我们需要使用以下链接使用AppPasswords功能。
https://myaccount.google.com/u/0/apppasswords

如下所示图像,使用Google提供的16位数字代码代替密码。

Less secure apps (https://myaccount.google.com/u/0/lesssecureapps) option has been disabled by google.

We need to use apppasswords feature using following link.
https://myaccount.google.com/u/0/apppasswords

As shown in following image, Use 16 digit code provided by google in place of password.

enter image description here

沉默的熊 2025-02-14 12:35:37

亲爱的adnan,首先,请更改

“”`

第二个请删除Bactick从Mail_from_name =

Hi dear adnan first of all please change the [email protected] to real Gmail account. And make your that email you are using not have setup 2 step authentication or any security.....

And the second please remove bactick from MAIL_FROM_NAME=""`

After all don't forget to clear cache

Run: php artisan optimize:clear

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文