SMTP 服务器不接受连接或尝试在 cakePHP 上使用 TLS 连接到非 TLS SMTP 服务器
当我将代码移至新服务器时,我的 cakePHP2.7 项目出现以下错误。该代码在我现有的所有服务器上运行良好。
我们使用 aws SES 作为邮件服务。 我们按照 https 的指示创建了一个示例文件: //docs.aws.amazon.com/ses/latest/dg/send-using-smtp-programmatically.html 也可以正常工作。 任何帮助都是适用的
代码供您参考
public $mailarr = array(
'host'=>'email-smtp.us-west-2.amazonaws.com',
'port' => 587,
'username' => 'XXXXXXXXXXXXXXX',
'password' => 'XXXXXXXXXXX',
'tls'=>true,
'returnPath'=>'[email protected]',
'transport' => 'Smtp',
'from' => array('[email protected]' => 'Alert!'),
'emailFormat' => 'html',
'timeout' => 300,
);
我已尝试将以下内容添加为我的 mailarr 的一部分,但错误仍然存在
'context' => array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
),
)
I get the following error on my cakePHP2.7 project when I move the code to my new server. The code works fine on all my existing servers.
we are using aws SES as mail service.
We created a sample file as instructed by https://docs.aws.amazon.com/ses/latest/dg/send-using-smtp-programmatically.html and that also works fine.
Any help is appriciated
code for your reference
public $mailarr = array(
'host'=>'email-smtp.us-west-2.amazonaws.com',
'port' => 587,
'username' => 'XXXXXXXXXXXXXXX',
'password' => 'XXXXXXXXXXX',
'tls'=>true,
'returnPath'=>'[email protected]',
'transport' => 'Smtp',
'from' => array('[email protected]' => 'Alert!'),
'emailFormat' => 'html',
'timeout' => 300,
);
I have tried to add the below as part of my mailarr but the error still persists
'context' => array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
),
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CakePhp 使用自己的 cacert.pem 文件。
它位于vendor\cakephp\cakephp\config\cacert.pem
下载最新的cacert.pem 来自 cURL 网站 的文件
CakePhp uses its own cacert.pem file.
It is in vendor\cakephp\cakephp\config\cacert.pem
Download the latest cacert.pem file from cURL website