fwrite():发送12个字节失败,errno = 32 Broken pipe

时间:2017-07-04 10:13:03

标签: codeigniter email smtp

我尝试发送包含用户名和许可证代码等动态内容的广播电子邮件,我正在测试将此邮件发送到两封电子邮件并且成功,但是当我发送到很多电子邮件时,我会收到以下错误代码。< / p>

PS: 我的数据中有785封电子邮件。

代码:

    $config = Array(
            'protocol' => 'smtp',
            'smtp_host' => 'ssl://mail.iamprima.com',
            'smtp_port' => 465,
            'smtp_user' => 'info@iamprima.com',
            'smtp_pass' => 'localhost8080',
            'smtp_timeout' => '4',
            'mailtype'  => 'html', 
            'charset'   => 'iso-8859-1'
        );

        // $query   = $this->db->query("SELECT a.master_atlet_email, a.master_atlet_username, b.license_code
// FROM `master_information_personal` as a 
// LEFT JOIN users as b on b.username = a.master_atlet_username
// WHERE a.master_atlet_username IN ('setiawan','nando')");

        $query  = $this->db->query("SELECT a.master_atlet_email, a.master_atlet_username, b.license_code
FROM `master_information_personal` as a 
LEFT JOIN users as b on b.username = a.master_atlet_username
WHERE a.master_atlet_email <> ''");
        if($query->num_rows()>0){
            foreach($query->result() as $row){
                $license_code           = $row->license_code;
                $master_atlet_email     = $row->master_atlet_email;
                $master_atlet_username  = $row->master_atlet_username;
                $data["licence"]    = $license_code;
                $data["subject"]    = "IAM PRIMA Reset Password";
                $data["username"]   = $master_atlet_username;
                $this->email->initialize($config);
                $this->email->set_newline("\r\n");
                $this->email->from('info@iamprima.com', 'Team IAM PRIMA');
                $list = array($master_atlet_email);
                $this->email->to($list);
                $this->email->subject('Form Untuk Reset Password');
                $body = $this->load->view('form_reset_password',$data,TRUE);
                $this->email->message($body); 
                $send = $this->email->send();
            }
        }
        if ($send) {
            echo 'Email sent.';
        } else {
            show_error($this->email->print_debugger());
        }

错误:

    Severity: Warning

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

Filename: libraries/Email.php

Line Number: 2172

Backtrace:

File: /home/panelprima/public_html/reset/application/modules/reset/controllers/Reset.php
Line: 78
Function: send

File: /home/panelprima/public_html/reset/index.php
Line: 318
Function: require_once

任何解决方案吗?

0 个答案:

没有答案