Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php OpenSSL错误消息:错误:带有MyBB SMTP的1416F086_Php_Email_Ssl - Fatal编程技术网

Php OpenSSL错误消息:错误:带有MyBB SMTP的1416F086

Php OpenSSL错误消息:错误:带有MyBB SMTP的1416F086,php,email,ssl,Php,Email,Ssl,我有一个MyBB实例在CentOS服务器上运行。我觉得我什么都试过了,但似乎无法通过SMTP可靠地发送邮件 它曾经工作过,然后它停止了,然后它突然又开始工作,没有我的任何干预。现在它又停止工作了,我不知道它为什么不工作 当我运行此PHP文件时: <?php $ch = curl_init('https://www.howsmyssl.com/a/check'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exe

我有一个MyBB实例在CentOS服务器上运行。我觉得我什么都试过了,但似乎无法通过SMTP可靠地发送邮件

它曾经工作过,然后它停止了,然后它突然又开始工作,没有我的任何干预。现在它又停止工作了,我不知道它为什么不工作

当我运行此PHP文件时:

<?php
$ch = curl_init('https://www.howsmyssl.com/a/check');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
$json = json_decode($data);
echo "<p>Your TLS version is: " . $json->tls_version . "</p>\n";
echo "<br>";
var_dump(openssl_get_cert_locations());
echo "<br>";
echo "<br>";
echo "Email test";
echo "<br>";


define('IN_MYBB', 1);

define('THIS_SCRIPT', 'email_test.php');



require_once('global.php');



function myErrorHandler($errno, $errstr, $errfile, $errline)

{
        print "Error No: " . $errno;
        print "<br>";
        print "Error String: " . $errstr;
        print "<br>";
        print "Error File: " . $errfile;
        print "<br>";
        print "Error Line: " . $errline;

}



set_error_handler( 'myErrorHandler' );



my_mail( 'email@email.com', 'Testing...', 'This is a test' );



?>
我已使用
yum-update
确保所有内容都是最新的

我尝试在php.ini中手动设置cacert.pem文件,该文件是从以下网站新下载的:

我在共享主机帐户上尝试了MyBB和我的SMTP凭据(Office 365),效果很好。我也尝试过Gmail,但仍然不起作用

我的服务器上的时间是正确的。我确信防火墙是开放的,允许SMTP通过(服务器运行在我无法控制的hyper-v服务器上-除了向提供商发送电子邮件并等待回复之外)

我已经没有主意了

Your TLS version is: TLS 1.3


array(8) { ["default_cert_file"]=> string(45) "/opt/cpanel/ea-openssl11/etc/pki/tls/cert.pem" ["default_cert_file_env"]=> string(13) "SSL_CERT_FILE" ["default_cert_dir"]=> string(42) "/opt/cpanel/ea-openssl11/etc/pki/tls/certs" ["default_cert_dir_env"]=> string(12) "SSL_CERT_DIR" ["default_private_dir"]=> string(44) "/opt/cpanel/ea-openssl11/etc/pki/tls/private" ["default_default_cert_area"]=> string(36) "/opt/cpanel/ea-openssl11/etc/pki/tls" ["ini_cafile"]=> string(0) "" ["ini_capath"]=> string(19) "/etc/ssl/cacert.pem" }

Email test
Error No: 2
Error String: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Error File: /home/%user%/public_html/forum/inc/mailhandlers/smtp.php
Error Line: 317