Solved

Problem in Sending Email Format

Posted on 2004-10-01
3
224 Views
Last Modified: 2006-11-17
In ASP I use a code for sending Email in HTML format. The ASP code are as follows :
===================
details="<html><body><table bgcolor=#ffffff>"
for Field = 4 To Request.Form.Count
details=details & "<tr><td><B>" & Request.Form.key(Field) & "</B></td><td><B>&nbsp:&nbsp</B></td><td>" & Request.Form(Field) & "</td></tr>"
next
details=details & "</table></body></html>"
set Mailer = Server.CreateObject("Persits.MailSender")Mailer.Host = Request.Form("HostSMTP")
Mailer.From = Request.Form("Email1")
Mailer.AddAddress "order@niwell.com"
Mailer.Subject = Request.Form("Subject")
Mailer.IsHTML = true
Mailer.Body = details
Mailer.Send
set Mailer = Nothing
=========================
This code send an email in this format :
==========================
Domain_Name  :  bubai
Extension  :  .name
Renewal_Period  :  7
Contact_Name  :  Subhasish Nag
Company  :  Nag Enterprises
Phone  :  25855465
Email1  :  bubai_nag@indiatimes.com
Email2  :  
=========================

But I face a problem when I send the same email in PHP. The PHP code are as follows :
**********************************
$details="<html><body><table bgcolor='#ffffff'>";
foreach($_POST as $key => $value)
{
$details.="<tr><td><b>".$key."</b></td><td><b>&nbsp;&nbsp;</b></td><td>".$value."</td></tr>";
}
$details.="</table></body></html>";
$to="backoffice@niwell.com";
$subject=$HTTP_POST_VARS["subject"];
$from=$HTTP_POST_VARS["Email1"];
$headers="From: $from\r\n";
$headers.= "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
mail($to,$subject,$details,$headers);
*******************************

But this code send an email in this format :
**********************************
<html><body><table bgcolor='#ffffff'><tr><td><b>subject</b></td><td><b>&nbsp;&nbsp;</b></td><td>CC - Domain Registration</td></tr><tr><td><b>redirect</b></td><td><b>&nbsp;&nbsp;</b></td><td>http://www.hostmac.com/cccart-redirect.htm</td></tr><tr><td><b>Domain_Name</b></t.............
************************************
Why the email send in this format ? There are any wrong in my PHP code. I want the email send the above ASP coded email format. Please short out this problem as soon as possible. It is very urgent
0
Comment
Question by:bubai_nag
3 Comments
 
LVL 6

Accepted Solution

by:
masirof earned 50 total points
ID: 12206383
Looks like you are trying to write HTML in HTML. Remove your <html><body> tags and try again.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now