?
Solved

Problem in Sending Email Format

Posted on 2004-10-01
3
Medium Priority
?
234 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 200 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
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 look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

741 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