我正在使用codeigniter的电子邮件库。此代码正确地将邮件发送到$to
变量,但不是$cc
和$bcc
。如果有人可以的话,请帮助我!
$this->load->library('email');
$this->email->from($from);
$this->email->bcc($bcc);
$this->email->cc($cc);
$this->email->to($to);
$this->email->subject($subject);
$this->email->message($content);
$this->email->send();
答案 0 :(得分:0)
你错了代码,在BCC上使用一个数组。
$this->email->bcc(array($this->input->post('bcc_email')));
答案 1 :(得分:-1)
使用此库:
$this->load->library('email');
然后使用此代码,它在我身边工作:
$this->email->from('your@example.com', $this->input->post('fullname'));
$this->email->to($this->input->post('email'));
$this->email->cc($this->input->post('cc_email'));
$this->email->bcc($this->input->post('bcc_email'));
$this->email->subject('Registeration Notification');
$this->email->message('You have registered successfully.\nYour username is :'.$this->input->post('email'));
$this->email->send();