I am making a piece of code for a website and made the following code, however i need to put html in the email however it doesn't send it, it only attaches the image, please help?
<?php
$emailSubject = 'Application - '.$_POST['full_name'].'';
$webMaster = 'email@webaddress.com';
$from = $_POST["email"];
$tmpName = $_FILES['attachment']['tmp_name'];
$fileType = $_FILES['attachment']['type'];
$fileName = $_FILES['attachment']['name'];
$headers = "From: $fromName";
if (file($tmpName)) {
$file = fopen($tmpName,'rb');
$data = fread($file,filesize($tmpName));
fclose($file);
$randomVal = md5(time());
$mimeBoundary = "==Multipart_Boundary_x{$randomVal}x";
$headers .= "
MIME-Version: 1.0
";
$headers .= "Content-Type: multipart/mixed;
" ;
$headers .= " boundary=\"{$mimeBoundary}\"";
$message = "This is a multi-part message in MIME format.
" .
"--{$mimeBoundary}
" .
"Content-Type: text/plain; charset=\"iso-8859-1\"
" .
"Content-Transfer-Encoding: 7bit
" .
$message . "
";
$data = chunk_split(base64_encode($data));
$message .= "--{$mimeBoundary}
" .
"Content-Type: {$fileType};
" .
" name=\"{$fileName}\"
" .
"Content-Transfer-Encoding: base64
" .
$data . "
" .
"--{$mimeBoundary}--
";
}
$html_message = "<html>"
$email_message = mail($webMaster, $emailSubject, $message, $headers);
$result = 'Result Code Here On Page';
echo "$result";
?>