Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/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 SMTP主机地址随“一起添加”;至;电子邮件地址_Php_Codeigniter_Email - Fatal编程技术网

Php SMTP主机地址随“一起添加”;至;电子邮件地址

Php SMTP主机地址随“一起添加”;至;电子邮件地址,php,codeigniter,email,Php,Codeigniter,Email,我正在使用CodeIgniter发送多封电子邮件。当我发送电子邮件时,我的smtp主机地址也添加到“收件人”电子邮件地址中。请帮忙。而且,即使在使用print_debugger()之后也没有输出 下面是代码 控制器 function massmail(){ $config = Array( 'protocol' => 'sendmail', 'smtp_host' => '..ser

我正在使用CodeIgniter发送多封电子邮件。当我发送电子邮件时,我的smtp主机地址也添加到“收件人”电子邮件地址中。请帮忙。而且,即使在使用print_debugger()之后也没有输出

下面是代码

控制器

function massmail(){
            $config = Array(       
                'protocol' => 'sendmail',
                'smtp_host' => '..server.net',
                'smtp_port' => 25,
                'smtp_user' => 'email@test.com',
                'smtp_pass' => 'password',
                'smtp_timeout' => '10',
                'mailtype'  => 'html',
                'charset'   => 'iso-8859-1'
            );

            $this->load->library('email', $config);
            $this->email->set_newline("\r\n");

            $data['send_emails'] = $this->email_model->getmails();
            $body = $this->load->view('view/newmail',$data,TRUE);
            foreach ($data['send_emails'] as $name => $address){ 
                $this->email->clear();
                $this->email->to($address);
                $this->email->from('from@mailsender.com');
                $this->email->subject('Email subject '.$name);                
                $this->email->message($body);
                $this->email->send();
            }

            echo $this->email->print_debugger();

        }
型号

function getmails(){
            $query = $this->db->query("select email from table_name where email !=''");
            return $query->result_array();
        }
查看

newmail.php

<table>
    <tr>
        <td>this is a test</td>
    </tr>
</table>

这是一个测试
产生电子邮件客户端

from:   from@mailsender.com
reply-to:   "from@mailsender.com" <from@mailsender.com>
to: 2@sg2plcpnl0205.XXX.XXXX.XXXXXX.net,
jose@sg2plcpnl0205.XXX.XXXX.XXXXXX.net,
3444@sg2plcpnl0205.XXX.XXXX.XXXXXX.net,
tomail@receiver.com,
0@sg2plcpnl0205.xxx.xxxx.xxxxxxx.net
date:   Tue, Sep 6, 2016 at 8:56 PM
subject:    this is a test
encryption: Standard (TLS)
来自:from@mailsender.com
答复:from@mailsender.com" 
致:2@sg2plcpnl0205.XXX.XXXX.XXXXXX.net,
jose@sg2plcpnl0205.XXX.XXXX.XXXXXX.net,
3444@sg2plcpnl0205.XXX.XXXX.XXXXXX.net,
tomail@receiver.com,
0@sg2plcpnl0205.xxx.xxxx.xxxxxxx.net
日期:2016年9月6日星期二晚上8:56
主题:这是一个测试
加密:标准(TLS)