您好,我使用codeigniter控制器發送電子郵件後,從數據庫中獲取數據。但問題是,當電子郵件到達$this->email->initialize($config);
,同時調試它與錯誤Codeigniter控制器顯示錯誤
Severity: Notice
Line Number: 563
一切看起來精緻漂亮崩潰,而我通常使用這個電子郵件功能在很多地方。但我無法弄清楚這個錯誤。 這是控制器中的代碼。
public function sendReminderForUnpaidInvoice() {
//fetch tha data from the database
$this->load->model('invoice_page');
$foo = $this->invoice_page->get();
$result = json_decode(json_encode($foo), true);
foreach ($foo as $result){
$this->load->library('../controllers/payment');
$resultMangoPay = $this->payment->getMangopayPayinForTheInvoiceMail($result->rf_reference);
$totalAmount = ($result->gross_amount) + ($result->type_related_amount) ;
$this->load->library('email');
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_port'] = '465';
$config['smtp_timeout'] = '7';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = '#########';
$config['charset'] = 'utf-8';
$config['newline'] = "\r\n";
$config['mailtype'] = 'text'; // or html
$config['validation'] = TRUE; // bool whether to validate email or not
$this->email->initialize($config); // line 563
$this->email->from('[email protected]', 'aurora exchange');
$this->email->to($result->Email);
$this->email->subject('Repayment invoice');
$this->email->message(
'Hello '.$result->Fullname.'.'."\n"
.'Here is a invoice for the next upcoming payment. '."\n"."\n"
.'Payment should be done by bank transfer to the information provided below'."\n"
.'Name :'.$resultMangoPay['OwnerName']
.'IBAN :'.$resultMangoPay['IBAN']
);
$returnvalue = $this->email->send();
if(!$returnvalue) {
return false;
} else {
// will do something here later
}
$this->email->clear(TRUE);
}
}
你在使用'$ email'的地方? –
@OwaisArain沒有問題,這就是問題 – Aurora
'行號:563' – devpro