Sorry, can anyone help please?
We had some PHP code which emailed a person enquiring about our services on our website. The email used to give a standard email response back to the enquirer formatted in HTML. But sometime in June 2020 although we couldn't see that any changes were made, the emails started sending without HTML format and basically showing the HTML code.
Below is the part of the PHP code which creates the email but I can't see anything wrong with it. So if there is no issue with the code below, what could cause the code to suddenly break and change the response emails which were working in HTML to start sending as HTML code? (or is there something wrong with the code I can't see?)
Any help, pointers or ideas would be really appreciated.
$email_from = '[email protected]';//<== update the email address
$email_subject = "Thank You for making enquiry";
$email_body = '<!DOCTYPE html>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Crimson+Text" rel="stylesheet">
<html>
<head>
<title></title>
</head>
<body>
EMAIL CONTENT WILL GO HERE!
</body>
</html>';
$to = $EnquiryEmailAddress;//<== update the email address
// Always set content-type when sending HTML email
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type:text/html;charset=ISO-8859-1' . "\r\n";
$headers .= "From: $email_from \r\n";
$headers .= "Reply-To: $email_from \r\n";
mail($to,$email_subject,$email_body,$headers);
erroryou recieve? check theerror.logfile as well - Burhan Kashour