quicky question. I have set a custom error handler for an application I am making that writes to an error log and will also generate an html email to the main administrator using the code below.
function log_to_errors($number, $message, $file, $line, $vars){
if(ENVIRONMENT !== 'development'):
ini_set('log_errors', 1);
ini_set('error_log', '../error_logs.txt');
$email = "
<div style='background: rgb(224, 224, 224); padding: 5px 10px;'>
<p>An error reference of ".$number." has occured on line: ".$line." in: <strong>".$file."</strong></p>
<p>".$message."</p>
<pre>".print_r($vars, 1)."</pre>
</div>
";
$email_header = 'Content-type: text/html; charset=iso-8859-1;';
error_log($email, 1, ADMIN_EMAIL, $email_header);
endif;
}
set_error_handler('log_to_errors');
I would like to amend this line:
$email_header = 'Content-type: text/html; charset=iso-8859-1;'
so that I can set custom information for the other email credentials ie the 'from and subject' elements of the email but when I try and do something like this:
$email_header = 'From:errors@example.com; Content-type: text/html; charset=iso-8859-1;';
it breaks the html in the email. Can someone point me in the right direction so I can set a message subject etc for the email.
Many thanks, Lewis