我试图弄清楚为什么我的用户会收到从我的 Web 应用程序发送的电子邮件的重复副本。这是发送电子邮件的代码:
function _send_user_email($to, $subject, $message) {
$this->load->library('email');
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';
$config['protocol'] = 'sendmail';
$this->email->initialize($config);
$this->email->from('support@mysite.com', 'Customer Service');
$this->email->reply_to('support@mysite.com', 'Customer Service');
$this->email->to($to);
$this->email->bcc('support@mysite.com');
$this->email->subject($subject);
$this->email->message($message);
$this->email->send();
if ( ! $this->email->send())
{
echo $this->email->print_debugger();
exit;
}
}
此代码是否有任何问题可能导致消息被发送两次?