The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> HTML NOT DISPLAYING IN PHP MAILBACK, Php form is not displaying html in the inbox when it sends a mailback
mario
post Jun 14 2012, 01:29 AM
Post #1





Group: Members
Posts: 4
Joined: 28-March 12
Member No.: 16,812



The following is the code i used in my website form.
the form is function as it should but the issue is the email that is received is showing the html code in the inbox insted of rendering the html as it should.

site located at: www.yellow.navmana.com

CODE
<?php

$contact= $_REQUEST['email'];

$to = $contact;
$subject = "Welcome to YellowTrunk.com";
$message1 = <<<EOD
<html>
    <head>
    <head>
    <body>
        <h1 style="color:#3399cc;">Test Mail</h1>
    </body>
</html>
EOD;
$message2 = "\nThe following person contacted you on the website\n\nEmail : ".$contact;
$from = "info@yellowtrunk.com";
$headers = "From: $from";
$headers2 = "From: $contact";
mail($to,$subject,$message1,$headers);
mail($from,$subject,$message2,$headers2);


?>


Urgent help reqired please ! unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 14 2012, 07:52 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



You must get a content-type header in there and set it to 'text/html'. Found this example.
http://css-tricks.com/sending-nice-html-email-with-php/
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th April 2024 - 10:27 AM