【发布时间】:2023-04-02 16:10:01
【问题描述】:
我有一个项目,它有一个从请求发送电子邮件的模块。我使用 beautymail 包作为电子邮件模板。我可以使用 gmail 帐户发送电子邮件,但是我从我的客户那里收到这封电子邮件,其中包含客户电子邮件地址。像这个xx.xxxxx@propnex.sg,他们说邮件是smtp服务器。所以我尝试在 laravel 中配置我的.env 和其他配置文件。但是我在发送Connection could not be established with host mail.propnex.sg :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number 时收到此错误有人可以告诉我为什么我收到此错误以及我应该怎么做才能摆脱这个错误?非常感谢
.env 配置
MAIL_DRIVER=smtp
MAIL_HOST=mail.propnex.sg
MAIL_PORT=587
MAIL_USERNAME=xx.xxxxx@propnex.sg
MAIL_PASSWORD=xxxxxxxx
MAIL_ENCRYPTION=ssl
邮件.php
'from' => [
'address' => 'xx.xxxxx@propnex.sg',
'name' => 'Propnex',
],
'reply_to' => ['address' => 'xx.xxxxx@propnex.sg', 'name' => 'Propnex'],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'port' => env('MAIL_PORT', 587),
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'mail.propnex.sg'),
【问题讨论】: