Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.