PHP email not sending in html format -
i trying php email send in html format, current email sending in code. not sure @ doing wrong.
does see anything?
ini_set('display_errors', 1); error_reporting(e_all); $project_name = $_post['project_name']; $title_roll = $_post['title_roll']; $project_email = $_post['project_email']; $project_number = $_post['project_number']; $project_description = $_post['project_description']; $project_source = $_post['project_source']; $project_socialmedia = $_post['project_socialmedia']; $project_humantest = $_post['project_humantest']; $to = 'email'; $subject = 'project inquiry form sent'; //$message = 'from: '.$project_name. "<br>" . ' email: '.$project_email. "<br>" . 'message: '.$project_description; //$msgcontents = "name: $project_name<br>email: $project_email<br>message: $project_description"; $message = ' <html> <head> <title>project inquiry form sent</title> </head> <body> <p>hi optimum designs team,</p><br> <p>there has been project submitted. here details:</p><br> <p>name: '. $project_name .'</p> <p>name: '. $title_roll .'</p> <p>name: '. $project_email .'</p> <p>name: '. $project_number .'</p> <p>name: '. $project_description .'</p> <p>name: '. $project_source .'</p> <p>name: '. $project_socialmedia .'</p><br> <p>good luck,</p> <p>administration</p> </body> </html> '; // send html mail, content-type header must set $headers = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers = 'from:' .$project_email . "\r\n"; if (!empty($project_email)) { if (filter_var($project_email, filter_validate_email)) { //should check on mail function if (mail($to, $subject, $message, $headers)) { echo "your email sent!"; // success message } else { echo "mail not sent!"; // failed message } } else { //invalid email echo "invalid email, please provide valid email address."; } } else { echo "email address not filled out."; }
that's because last header
$headers = 'from:' .$project_email . "\r\n";
is missing concatenate
$headers .= 'from:' .$project_email . "\r\n"; ^ right there
in turn breaking chainlink.
Comments
Post a Comment