Solved

Problem in Sending Email Format

Posted on 2004-10-01
3
230 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to count occurrences of each item in an array.

695 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