Jump to content

php text formatting on formmail


hoachen
 Share

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...