Jump to content

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.

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.