Get Debug Message
public print_debugger ( array $include = ['headers', 'subject', 'body'] ) : string | ||
$include | array | List of raw data chunks to include in the output Valid options are: 'headers', 'subject', 'body' |
return | string |
$subject = 'subject to test email'; // Pass some data into the email templates $email_data = array(); $email_data['firstname'] = 'Look'; $email_data['lastname'] = 'look'; $email_data['email'] = '*****@*****.**'; define('MB_ENABLED', TRUE); define('ICONV_ENABLED', TRUE); $email_sender = new CI_Email($config); $email_sender->from($from_address, $form_name); $email_sender->to($to_address); $email_sender->subject($subject); $email_sender->message(view('email_template', $email_data)); //$email_sender->set_alt_message(view('email_template', $email_data)); if (!$email_sender->send()) { exit('error' . 'User::create - Unable to send new user email. Response is as follows:' . $email_sender->print_debugger() . "\n\n"); } else { echo 'email sent'; } // Load view function function view($path, $data) { ob_start(); extract($data); include $path . '.php'; return ob_get_clean(); } function is_php($version) { static $_is_php; $version = (string) $version;