CodeIginter 3电子邮件库$ to字段不起作用,但$ cc确实如此

时间:2016-03-18 18:10:01

标签: php codeigniter email

我有一个简单的功能,通过电子邮件发送提醒消息。我正在使用CodeIginter 3和它的电子邮件库。当我从我的测试机上运行Controller时,它工作正常,但是当我从我的网络服务器运行它时,它只会将电子邮件发送到$ cc或$ bcc字段中列出的那些,任何列为收件人($ to)赢得的'收到任何电子邮件。

$this->load->library('email');
    $lateE = $this->Equipment_model->get_late_equipment_report();

    foreach($lateE as $le){

        $this->email->from('no-reply@server.com', 'Reminder');
        $this->email->to($le->email,'test1@server.com','test2@yahoo.com'); 
        $this->email->cc('test3@gamil.com');  
        $this->email->bcc('test4@yahoo.com'); 
        $this->email->subject('Late Reminder');

        $mail = "This message is a reminder that you have checked out Equipment \n\r\n\r";

        $mail .=" Name: ". $le->first ." ". $le->last ."\n\r";
        $mail .=" Reminder: ". $le->pack ."\n\r";
        $mail .=" Due back on: ". $le->returndate ."\n\r\n\r"; 

        $this->email->message($mail);   

        //echo $this->email->print_debugger();
        $this->email->send();
    }

1 个答案:

答案 0 :(得分:0)

to字段 有效。但不是多个参数:

Email.php (~600)

/**
 * Set Recipients
 *
 * @param   string
 * @return  CI_Email
 */
public function to($to)

它期待一个字符串。