Hello, I have a php file that I am trying to send the output in a email using the php mail function (PHPMailer is not an option as the server I am working restricts their SMTP server). The code for the mail function is
$to = "[email protected]";
$subject = "Outdoor Grill Service Request";
ob_start();
require 'grill-form.php';
$body = ob_get_clean();
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers = "From: [email protected]\n";
mail($to,$subject,$body,$headers);
echo "Mail sent to $to";
grill-form.php is a php file that contains a html file that has tables that are populated with php variable from a form. This worked perfectly using PHPMailer but once I migrated over to standard php mail is got "screwy".
The issue I am running into is when the email sends I am getting raw HTML code and not the output of the grill-form.php (a styled table with values). I have little knowledge with the php mail function so I might be missing something stupid.
Was wondering what I am doing wrong. Thank you in advance for you help you people are the best.