Jump to content

PHP HTML email problems


jimjiminyjimjim

Recommended Posts

I had a PHP script that sent an html email from a Flash form. It was all working on a Windows based server. Then my server was switched to a Linux based one. It now sends the email, but has a lot of random characters and doesn't format the text using the html tags.

 

This is the email I get sent (the message part) the From and Subject lines are correct:

 

Content-type: text/html; charset=iso-8859-1

 

From: test<*********@hotmail.com>

 

Reply-To: *********@hotmail.com

 

Message-Id: <20070814210131.34F6213DCB@****.net>

Date: Tue, 14 Aug 2007 14:01:30 -0700 (PDT)

 

<p><b>Company:</b>test company</p><p><b>Telephone:</b>test telephone</p><p><b>Enquiry:</b>test enquiry</p>

 

 

 

Here is the PHP code I was using:

 

 


<?php
// multiple recipients
$to  = '******@gmail.com' . ', '; // note the comma

$message = $_POST["message"];   
$telephone = $_POST["telephone"];  
$company = $_POST["company"]; 

// subject
$subject = 'Inquiry';

// message


$mail = "<p><b>Company:</b>" . $company . "</p>" . "<p><b>Telephone:</b>" . $telephone . "</p>" . "<p><b>Enquiry:</b>" .$message . "</p>"; 

$headers  = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From: " . $_POST["name"] . "<" . $_POST["email"] .">\r\n";   
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";   
$headers .= "Return-path: " . $_POST["email"];   


// Mail it
mail($to, $subject, $mail, $headers);

?>

 

What about the server change has caused this not to work???? Any help would be greatly appreciated. Thanks

 

Link to comment
https://forums.phpfreaks.com/topic/64950-php-html-email-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.