I cannot Send HTML EMBEDED Code in email. I am using the following code. I cant understand where i am going wrong . Please help me out . This code works fine but HTML raw codes are displayed in email, not in the format i want to show them. Please help me out below is the code.
Also tell me another thing when code send the email to my email id the email id shown is the server mail id. Not the email id which the user has sent in email field.
I want to show the email came from admin@samannoychatterjee.net not the server generated email id. What i need to do for that. Please help me out.
function sendmail()
{
$to = "info@samannoychatterjee.net";
$random_hash = md5(date('r', time()));
$subject = $_REQUEST['subject'];
$fullname=$_REQUEST['fullname'];
$from=$_REQUEST['email'];
$contactno=$_REQUEST['contactno'];
$msg=$_REQUEST['msg'];
$body = "<html><body>Hi Samannoy Chatterjee,\n\n"."This is <strong>".$fullname."</strong>"."\n"."You can get back to me through e-Mail ID - <strong>".$from."<\strong>\n"."My Contact Number is <strong>".$contactno."</strong>\n"."My Queries is as follows :<strong>".$msg."</strong>\n\n"."Note: This information is sent by mail from <strong>SAMANNOY CHATTERJEE . NET- <a href=\"www.goenkajewellers.com"." "."target=\"_blank"." "."title=\"SamannoyChatterjee.net Website\">WWW.SAMANNOYCHATTERJEE.NET</a></strong></body></html>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .="Content-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";
$headers .= "From:".$from."\r\n"."X-Mailer: php\r\n";
if (mail($to, $subject, $body, $headers))
{
$GLOBALS['msg']="Message Sucessfully Sent. We will reply to you.";
main();
exit();
} else {
$GLOBALS['msg']="Message Not Sent.";
main();
exit();
}
}