我有一个项目,有一个根据请求发送电子邮件的模块。我使用 beautymail 包作为电子邮件模板。我可以使用 Gmail 帐户发送电子邮件,但我从客户那里收到的这封电子邮件中包含客户电子邮件地址。像这样[电子邮件受保护] /cdn-cgi/l/email-protection,他们说电子邮件是一个 smtp 服务器。所以我尝试配置我的.env
以及 laravel 中的其他配置文件。但我在发送时收到此错误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[email protected] /cdn-cgi/l/email-protection
MAIL_PASSWORD=xxxxxxxx
MAIL_ENCRYPTION=ssl
Mail.php
'from' => [
'address' => '[email protected] /cdn-cgi/l/email-protection',
'name' => 'Propnex',
],
'reply_to' => ['address' => '[email protected] /cdn-cgi/l/email-protection', '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'),