gpt4 book ai didi

php - Gmail 用户不会收到 Laravel 邮件

转载 作者:行者123 更新时间:2023-12-05 03:48:18 25 4
gpt4 key购买 nike

当我通过 laravel 非 Gmail 帐户发送电子邮件时,将收到 电子邮件,但 Gmail 帐户 不会,这里有人以前遇到过这样的问题吗? 知道是什么原因造成的吗?

As my emails are receiving with half of the users I don't think the issue is my code but just in case i share it here as well.

观察

class SellerObserve
{
public function created(Seller $seller)
{
Mail::to($seller->email)->send(new SellersWelcome($seller));
}
}

邮件

class SellersWelcome extends Mailable
{
use Queueable, SerializesModels;
public $seller;

public function __construct(Seller $seller)
{
$this->seller = $seller;
}

public function build()
{
return $this->subject('Welcome')->markdown('emails.sellers.welcome');
}
}

环境

MAIL_MAILER=sendmail
MAIL_HOST=MY_SERVER_IP
MAIL_PORT=587
MAIL_USERNAME=MY_EMAIL_ADDRESS
MAIL_PASSWORD=MY_EMAIL_PASSWORD
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=MY_EMAIL_ADDRESS
MAIL_FROM_NAME="${APP_NAME}"

最佳答案

我已将我的邮件设置更改为 GMAIL(我的发件人将是 gmail 而不是我的主机)然后我从帐户设置中打开了较低的安全性,现在它会向包括 gmail 用户在内的所有提供商发送电子邮件。

环境

MAIL_MAILER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=465
MAIL_USERNAME=MY_EMAIL_ADDRESS
MAIL_PASSWORD=MY_EMAIL_PASSWORD
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=MY_EMAIL_ADDRESS
MAIL_FROM_NAME="${APP_NAME}"

one

关于php - Gmail 用户不会收到 Laravel 邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64474125/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com