如何在codeigniter中发送电子邮件

时间:2014-01-08 13:14:14

标签: codeigniter

我是codeigniter的初学者,我不了解如何发送电子邮件。请有人可以帮忙吗?提前谢谢。

$config = Array(
                'mailtype'  => 'html', 
                );
              $this->load->library('email', $config);
              $this->email->set_newline("\r\n");
              $this->email->from('aaa@gmail.com', 'aaa');
              $this->email->to('bbb@gmail.com');  
              $this->email->subject('This is an email test');  
              $this->email->message('It is working. Great!');
              $result = $this->email->send();
              echo $this->email->print_debugger();

2 个答案:

答案 0 :(得分:1)

$this->email->initialize($config);
$this->email->from($from);
$this->email->to($to);
$this->email->subject($subject);
$this->email->message($mailContent);
($this->email->send())  

答案 1 :(得分:0)

{{2p>参考#{{3p>