我有一个项目,其中一个模块可以从请求中发送电子邮件。我正在使用beautymail包提供的电子邮件模板。我可以使用Gmail帐户发送电子邮件,但是我收到来自客户的电子邮件有一个自定义电子邮件地址,就像这样xx.xxxxx@propnex.sg,他们说这个电子邮件是一个SMTP服务器。因此,我尝试在laravel的
.env配置
.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
Mail.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'),