i need help to send email containing html code by php
Posted: Tue Nov 18, 2008 8:03 am
i am sending this email to my inbox but it not showing me the data in my design formate.
function sendemails($title,$fname,$sname,$email){
$orderNo_ses= $_SESSION['orderNo'];
//$theCustName ="";
//$orderno = "";
$emailTo = $email;
//$emailTo = "nick@lovelljohns.com";
//$emailBody ="";
$strCustomerName = $title . $fname . " " .$sname;
$strCurrentOrderNo = $orderNo_ses;
$strEmailbody = "<html><head><meta http-equiv='Content-Type'content='text/html; charset=iso-8859-1'>";
$strEmailbody .= "<title>GreenAsap Order Confirmation</title>";
$strEmailbody .= "<style type='text/css'>";
$strEmailbody .= "<!--";
$strEmailbody .= ".maintext {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#000000}";
$strEmailbody .= ".green {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#85BC3F}";
$strEmailbody .= ".purple {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#00365A}";
$strEmailbody .= ".grey {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#808080}";
$strEmailbody .= "-->";
$strEmailbody .= "</style></head><body>";
$strEmailbody .= "<img src='http://www.mapsinternational.co.uk/nic_temp/header.bmp'>";
$strEmailbody .= "<p class='maintext'>Dear " . $strCustomerName . ",</p>";
$strEmailbody .= "<p class='maintext'>Report order: " . $strCurrentOrderNo . "</p>";
$strEmailbody .= "<p class='maintext'>Thank you for ordering a <span class='green'><strong>Green</strong></span><span class='purple'><strong>Light</strong></span><span class='grey'><strong> Report</strong><sup>®</sup></span>.";
$strEmailbody .= "Your report order will be shortly processed by one of our skilled Environmental Surveyors.";
$strEmailbody .= "<p class='maintext'>Remember to regularly check <strong><a href='www.greenasap.com' class='green'>www.greenasap.com</a></strong> for new products and advice relating to green issues and property.</p><br/><br/>";
$strEmailbody .= "<p class='maintext'>The Green ASAP Team<br/>Green ASAP Ltd<br/><strong><a href='www.greenasap.com' class='purple'>www.greenasap.com</a></strong></p>";
$strEmailbody .= "<img src='http://www.mapsinternational.co.uk/nic_temp/footer.bmp'>";
$strEmailbody .= "</body></html>";
$emailSubject = "Your GreenASAP Order: " . $orderNo_ses;
//$emailDear1 = "Dear '" . $title.$fname ."".$sname. "',\r\n\r\n";
//$strEmailbody .= "Thank you for your order" ;
//$strEmailbody .= "Order No. ". $orderNo_ses . "\r\n";
//$strEmailbody .= "Order Details";
//$orderString = "[w[odfkcsdcmks;dlcm";
//$strEmailbody .= $orderString . "\r\n\r\n";
//$strEmailbody.= "Regards,\r\n";
//$strEmailbody .= "Wilbourn Associates";
//$emailDear1 = "Dear '" . $fname . "',\r\n\r\n";
//$emailBody .= "Thank you for your order" ;
//$emailBody .= "Order No. ". $orderNo_ses . "\r\n";
//$emailBody .= "Order Details";
//$orderString = "[w[odfkcsdcmks;dlcm";
//$emailBody .= $orderString . "\r\n\r\n";
//$emailBody .= "Regards,\r\n";
//$emailBody .= "Wilbourn Associates";
//$fullEmailBody = $emailDear1 . $emailBody;
$fullEmailBody = $strEmailbody ;
// To send HTML mail, the Content-type header must be set
//headers = "From: $from\r\n";
$emailHeaders = "MIME-Version: 1.0rn";
//$headers .= "Content-type: text/html; charset=iso-8859-1rn";
$emailHeaders .= "Content-Type'content='text/html; charset=iso-8859-1";
//***Send email to user and account admin where necessary.
$emailHeaders = 'From: ' . 'ADMIN_EMAIL';
if(mail($emailTo, $emailSubject, $fullEmailBody, $emailHeaders, '-f'.'ADMIN_EMAIL')){
}else{
echo "<p class='error' align='center'>There has been a problem sending your cofirmation email. <br/>Ensure your email address is correct or contact Wilbourn.</p>";
}
}
.......................
the result in inbox of this code is
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
<html><head><meta http-equiv='Content-Type'content='text/html; charset=iso-8859-1'><title>GreenAsap Order Confirmation</title><style type='text/css'><!--.maintext {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#000000}.green {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#85BC3F}.purple {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#00365A}.grey {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#808080}--></style></head><body><img src='http://www.mapsinternational.co.uk/nic_ ... er.bmp'><p class='maintext'>Dear Mr.LOVELL JOHN,</p><p class='maintext'>Report order: ASAP00000121</p><p class='maintext'>Thank you for ordering a <span class='green'><strong>Green</strong></span><span class='purple'><strong>Light</strong></span><span class='grey'><strong> Report</strong><sup>®</sup></span>.Your report order will be shortly processed by one of our skilled Environmental Surveyors.<p class='maintext'>Remember to regularly check <strong><a href='www.greenasap.com' class='green'>www.greenasap.com</a></strong> for new products and advice relating to green issues and property.</p><br/><br/><p class='maintext'>The Green ASAP Team<br/>Green ASAP Ltd<br/><strong><a href='www.greenasap.com' class='purple'>www.greenasap.com</a></strong></p><img src='http://www.mapsinternational.co.uk/nic_ ... ody></html>
function sendemails($title,$fname,$sname,$email){
$orderNo_ses= $_SESSION['orderNo'];
//$theCustName ="";
//$orderno = "";
$emailTo = $email;
//$emailTo = "nick@lovelljohns.com";
//$emailBody ="";
$strCustomerName = $title . $fname . " " .$sname;
$strCurrentOrderNo = $orderNo_ses;
$strEmailbody = "<html><head><meta http-equiv='Content-Type'content='text/html; charset=iso-8859-1'>";
$strEmailbody .= "<title>GreenAsap Order Confirmation</title>";
$strEmailbody .= "<style type='text/css'>";
$strEmailbody .= "<!--";
$strEmailbody .= ".maintext {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#000000}";
$strEmailbody .= ".green {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#85BC3F}";
$strEmailbody .= ".purple {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#00365A}";
$strEmailbody .= ".grey {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#808080}";
$strEmailbody .= "-->";
$strEmailbody .= "</style></head><body>";
$strEmailbody .= "<img src='http://www.mapsinternational.co.uk/nic_temp/header.bmp'>";
$strEmailbody .= "<p class='maintext'>Dear " . $strCustomerName . ",</p>";
$strEmailbody .= "<p class='maintext'>Report order: " . $strCurrentOrderNo . "</p>";
$strEmailbody .= "<p class='maintext'>Thank you for ordering a <span class='green'><strong>Green</strong></span><span class='purple'><strong>Light</strong></span><span class='grey'><strong> Report</strong><sup>®</sup></span>.";
$strEmailbody .= "Your report order will be shortly processed by one of our skilled Environmental Surveyors.";
$strEmailbody .= "<p class='maintext'>Remember to regularly check <strong><a href='www.greenasap.com' class='green'>www.greenasap.com</a></strong> for new products and advice relating to green issues and property.</p><br/><br/>";
$strEmailbody .= "<p class='maintext'>The Green ASAP Team<br/>Green ASAP Ltd<br/><strong><a href='www.greenasap.com' class='purple'>www.greenasap.com</a></strong></p>";
$strEmailbody .= "<img src='http://www.mapsinternational.co.uk/nic_temp/footer.bmp'>";
$strEmailbody .= "</body></html>";
$emailSubject = "Your GreenASAP Order: " . $orderNo_ses;
//$emailDear1 = "Dear '" . $title.$fname ."".$sname. "',\r\n\r\n";
//$strEmailbody .= "Thank you for your order" ;
//$strEmailbody .= "Order No. ". $orderNo_ses . "\r\n";
//$strEmailbody .= "Order Details";
//$orderString = "[w[odfkcsdcmks;dlcm";
//$strEmailbody .= $orderString . "\r\n\r\n";
//$strEmailbody.= "Regards,\r\n";
//$strEmailbody .= "Wilbourn Associates";
//$emailDear1 = "Dear '" . $fname . "',\r\n\r\n";
//$emailBody .= "Thank you for your order" ;
//$emailBody .= "Order No. ". $orderNo_ses . "\r\n";
//$emailBody .= "Order Details";
//$orderString = "[w[odfkcsdcmks;dlcm";
//$emailBody .= $orderString . "\r\n\r\n";
//$emailBody .= "Regards,\r\n";
//$emailBody .= "Wilbourn Associates";
//$fullEmailBody = $emailDear1 . $emailBody;
$fullEmailBody = $strEmailbody ;
// To send HTML mail, the Content-type header must be set
//headers = "From: $from\r\n";
$emailHeaders = "MIME-Version: 1.0rn";
//$headers .= "Content-type: text/html; charset=iso-8859-1rn";
$emailHeaders .= "Content-Type'content='text/html; charset=iso-8859-1";
//***Send email to user and account admin where necessary.
$emailHeaders = 'From: ' . 'ADMIN_EMAIL';
if(mail($emailTo, $emailSubject, $fullEmailBody, $emailHeaders, '-f'.'ADMIN_EMAIL')){
}else{
echo "<p class='error' align='center'>There has been a problem sending your cofirmation email. <br/>Ensure your email address is correct or contact Wilbourn.</p>";
}
}
.......................
the result in inbox of this code is
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
<html><head><meta http-equiv='Content-Type'content='text/html; charset=iso-8859-1'><title>GreenAsap Order Confirmation</title><style type='text/css'><!--.maintext {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#000000}.green {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#85BC3F}.purple {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#00365A}.grey {font-family: Helvetica, Arial, sans-serif;size: 12pt;color:#808080}--></style></head><body><img src='http://www.mapsinternational.co.uk/nic_ ... er.bmp'><p class='maintext'>Dear Mr.LOVELL JOHN,</p><p class='maintext'>Report order: ASAP00000121</p><p class='maintext'>Thank you for ordering a <span class='green'><strong>Green</strong></span><span class='purple'><strong>Light</strong></span><span class='grey'><strong> Report</strong><sup>®</sup></span>.Your report order will be shortly processed by one of our skilled Environmental Surveyors.<p class='maintext'>Remember to regularly check <strong><a href='www.greenasap.com' class='green'>www.greenasap.com</a></strong> for new products and advice relating to green issues and property.</p><br/><br/><p class='maintext'>The Green ASAP Team<br/>Green ASAP Ltd<br/><strong><a href='www.greenasap.com' class='purple'>www.greenasap.com</a></strong></p><img src='http://www.mapsinternational.co.uk/nic_ ... ody></html>