CODEIGNITER - fwrite(): SSL operation failed with code 1. OpenSSL Error messages: error:140D00CF:SSL routines:SSL_write:protocol is shutdown

CODEIGNITER - fwrite(): SSL operation failed with code 1. OpenSSL Error messages: error:140D00CF:SSL routines:SSL_write:protocol is shutdown

我有一个 smtp 电子邮件配置,可以通过 Codeigniter 发送电子邮件,如下所示:

$config = [
  'protocol' => 'smtp',
  'smtp_host' => 'ssl://cph.dnet.net.id',
  'smtp_port' => 465,
  'smtp_timeout' => 50,
  'smtp_user' => 'Myemail@domain.com',
  'smtp_pass' => 'MyPaSsWoRd',
  'smtp_keepalive' => 'TRUE',
  'mailtype' => 'html',
  'charset' => 'iso-8859-1'
];
$this->email->initialize($config); 

如果我只发送几封电子邮件,它总是有效。但是,当我发送大量电子邮件时,会出现如下错误:

Fatal error: Maximum execution time of 30 seconds exceeded in C:\XAMPP\htdocs\sicuti\system\libraries\Email.php on line 2268

错误通过将值 "max_execution_time" 中的 "php.ini" 编辑为 9999 来解决 .but codeigniter 显示如下新问题:

fwrite(): SSL operation failed with code 1. OpenSSL Error messages: error:140D00CF:SSL routines:SSL_write:protocol is shutdown

尽管我的 smtp 配置是正确的,但根据我的 cpanel 中的建议

如果只有几封邮件肯定可以,但是如果超过10封就会出现错误,我应该怎么改才能一次发多封邮件? 谢谢,我很感激任何回复。

我有一个循环发送多封邮件的功能,由于我一次发送了很多封邮件而导致错误,所以我对每封邮件都进行了重定向,以便正常发送。下面的循环函数我插入了重定向函数,效果很好:

function index () {
  if (!empty($this->Leave_Model->count_all_leave_wait())) {
    $leave_wait_data = $this->Leave_Model->get_all_leave_wait();
    foreach ($leave_wait_data as $res) {
      if (date('Y-m-d')>$res->Confirm_Date) {
        $this->Send_Leave_Request($res->L_Request_ID); # Send Email
        $this->Leave_Model->update_lvd_confirm_date($res->L_Request_ID); # Update Confirm Date When Success Send
        redirect('Login_Employe'); # Redirect
      }
    }
  }
}

function Send_Leave_Request ($id)
{
  # bla bla bla
  $this->email->message('Bla bla  la  bla  bla...');
  $this->email->send();
}