我在config文件夾中email.php:笨不是SMTP設置發送電子郵件
$config = Array(
'protocol' => 'tls',
'smtp_host' => 'mail.lifepro.ro',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'xxxxxxxxxxxx',
'mailtype' => 'html',
'charset' => 'utf-8',
'wordwrap' => TRUE
);
這個功能幫手
function email_send($to, $subject, $body) {
$ci = get_instance();
$ci->email->from('[email protected]', 'Office LifePro');
$ci->email->to($to);
$ci->email->cc('[email protected]');
$ci->email->subject($subject);
$ci->email->message($body);
if($ci->email->send())
return true;
}
的問題是,在CI甚至發送電子郵件如果我輸入錯誤的憑據。爲什麼發生這種情況?我知道配置文件夾中的email.php會自動加載。