我正在尝试在Laravel项目中配置电子邮件。尝试设置SSL加密,但无效。没有错误或警告。所有邮件都将发送到垃圾邮件。
SSL / TLS配置
Username: info@example.com
Password: ***.
Incoming Server: example.com
IMAP Port: *** POP3 Port: ***
Outgoing Server: example.com
SMTP Port: 465
我在.env中的配置
MAIL_DRIVER=mail // tried to use smtp
MAIL_HOST=example.com
MAIL_PORT=465 // 587 for NON SSL works ok
MAIL_USERNAME=info@example.com
MAIL_PASSWORD=***
MAIL_ENCRYPTION=tls // tried to set SSL, NULL with 587 port works fine
在config / mail.php中添加
'stream' => [
'ssl' => [
'allow_self_signed' => true,
'verify_peer' => false,
'verify_peer_name' => false,
],
],