You can further inspect what happened by using the email debugger:
$r = $this->send(FALSE);
if (!$r)
$this->email->print_debugger()
;
From the Codeigniter Email Class Reference.
If you need the debugger output as a string, you can just catch the output with an output buffer:
$errors = array();
... # Loop
$r = $this->send(FALSE);
if (!$r) {
ob_start();
$this->email->print_debugger();
$error = ob_end_clean();
$errors[] = $error;
}
... # Loop end
Codeigniter in more recent versions requires an explicit FALSE for the $auto_clear
parameter of the email->send()
function in order to not clear the message and the debugging, effectively killing the debugger function if you fail to pass the FALSE.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…