hoachen Posted June 10, 2006 Share Posted June 10, 2006 I have a very simple text form to test the text formatting. But, when i get on the email all the html tag is show instead of format them. Like below the <b>testing </b>. I will show the exactly on my email does not format as bold. also the line break <br /> it does the same as the <b></b>. I done this before on different server it works but on this new server. ANyone know what i am missing? Please help me to understand this.<?php$message .= "<b> testing </b>";$message .= "First Name: " . $_POST['name'] . "<br />";$message .= "<b>Email: </b>" . $_POST['email'];echo "thank you for....";mail('hoachen@hotmail.com,$subject,$message);?> Link to comment Share on other sites More sharing options...
Little Goat Posted June 10, 2006 Share Posted June 10, 2006 you must send this header: Content-type:text/htmlanyone correct me if I'm wrong. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 10, 2006 Share Posted June 10, 2006 Yeah, that's part of it. Read this page, it shows how to send HTML email:http://www.php.net/manual/en/function.mail.php Link to comment Share on other sites More sharing options...
hoachen Posted June 10, 2006 Author Share Posted June 10, 2006 i did tried but doesn't work either. you must send this header: Content-type:text/htmlanyone correct me if I'm wrong.<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
reportingsjr Posted June 11, 2006 Share Posted June 11, 2006 You did something wrong.. this is how mail() is set up: <?$to= "email adresses here comma seperated";$subject="subject of message here";$message='All HTML coding here';//this is for html$headers = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";//this is just optional stuff, you dont have to have$headers .= 'To: name <name@example.com>' . "\r\n";$headers .= 'From: hoachen <hoachen@hotmail.com>' . "\r\n";mail($to, $subject, $message, $header);?> There you go! that should work.. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 11, 2006 Share Posted June 11, 2006 You left out an "s" in the headers parameter for the mail function.Also, Hoachen, read that link I sent you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now