如何使用codeigniter smtp协议设置返回路径

时间:2016-03-19 10:30:46

标签: php codeigniter email smtp

我想在codeigniter中设置返回路径。我正在使用的协议是smtp,但这总是从返回路径中的地址显示。这是我的代码

        $emailConfig = array(
            'protocol' => 'smtp',
            'smtp_host' => '*****',
            'smtp_port' => 587,
            'smtp_user' => '*****',
            'smtp_pass' => '*****',
            'mailtype'  => 'html',
            'charset'   => 'iso-8859-1'
        );

        $from = array('email' => '***@gmail.com', 'name' => 'Jack');
        $reply_to = array('email' => '***@gmail.com', 'name' => 'Jack');
        $to = array('email' => $contact_email);

        $this->load->library('email', $emailConfig);
        $this->load->library('user_agent'); 

        // Set email preferences
        $this->email->from($from['email'], $from['name'], 'return_path@gmail.com');
        $this->email->reply_to($reply_to['email'],$reply_to['name']);
        $this->email->to($to);

        $this->email->subject($subject);
        $this->email->message($message);
提前

thanx

0 个答案:

没有答案