Jump to content

html email not working


garethhall

Recommended Posts

Hi I have the following script and I know that it work, well it works on the local host setup. When I submit the from(html page) I receive an html email and that works fine. But when it is running on my webserver it doesnt send an html email I receive an email well like this

 

 

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

From: Home Inspection Services Online Form < [email protected]>

<strong>Name: </strong>Amber Wason

<br><strong>Email Address: </strong><a href='mailto: [email protected]'>[email protected]</a>

<br><strong>Message: </strong>test

<br>

 

 

Here is my script: if anyone can help that would be great 

 

 

<?

$to = "[email protected]";

 

$subject = "Enquiry from website";

 

$message  = "<strong>Name: </strong>$_POST[name]\n\n<br>";

$message .= "<strong>Email Address: </strong><a href='mailto:$_POST'>$_POST</a>\n\n<br>";

$message .= "<strong>Home Type: </strong>$_POST[homeType]\n\n<br>";

$message .= "<strong>Number of Levels: </strong>$_POST[levels]\n\n<br>";

$message .= "<strong>Number of Beds: </strong>$_POST[beds]\n\n<br>";

$message .= "<strong>Area in Auckland: </strong>$_POST[area]\n\n<br>";

$message .= "<strong>Message: </strong>$_POST[message]\n\n<br>";

 

$headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$headers .= 'From: Home Inspection Services Online Form<[email protected]>' . "\r\n";

 

mail($to, $subject ,$message, $headers);

 

?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/80065-html-email-not-working/
Share on other sites

Are you sending the email to the same TO: address in both cases and are you using the same email client program to read both the working html email and the one that does not work?

 

The most likely guess for the case where it does not work is that the email client is setup for only plain text email.

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.