如何使用codeigniter邮件程序在我的邮件帐户中发送main?

时间:2015-02-12 08:55:27

标签: php codeigniter email

我使用codeigniter直接发送邮件.. 如何使用codeigniter邮件程序在我的邮件帐户中发送main?

我的代码:

    $ci = get_instance();
        $ci->load->library('email');
        $config['useragent'] = "Codeigniter";
        $config['protocol'] = "smtp";
        $config['smtp_host'] = "mail.example.com";
        $config['smtp_port'] = "25";
        $config['smtp_user'] = "account@example.com"; 
        $config['smtp_pass'] = "Password";
        $config['charset'] = "utf-8";
        $config['mailtype'] = "html";
        $config['newline'] = "\r\n";

        $ci->email->initialize($config);

        $ci->email->from('account@example.com', 'Account');
        $list = array($email);
        $ci->email->to($list);
        $this->email->reply_to('account@example.com', 'Account');
        $ci->email->subject('Verify your Email');
        $ci->email->message('Massge body contain');
        $ci->email->send();

我想通过account@example.com发送邮箱发送所有邮件。有可能吗?

1 个答案:

答案 0 :(得分:0)

更好地添加cc或bcc您的电子邮件帐户bcc

$this->email->cc('account@example');

or 

$this->email->bcc('account@example');