Solved

Problem in Sending Email Format

Posted on 2004-10-01
3
228 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

756 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