I am having problem with sending a table in php mail. i have searched for help in google.com and forums, but the reply am getting is as below; $message="<table> /*my content will go here*/ </table>"; PHP: or $message = ' <html> <head> <title></title> </head> <body> <table>/*my content will go here*/</table> </body> </html>'; PHP: which i tried but it will always show the table codes in the mail, not making the mail look readable. what else can i do? regards
If you are sending an HTML email, and you are only getting the HTML code as part of the email, you are not sending it as the correct content type. This isnt a problem with your formatting/body - you need to set the headers on the email so the email client is aware of this. Something like this should work, when you send it; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; PHP: You can include other headers by concatenating them onto the end (to, from, cc etc) and make sure you actually send the headers as part of the mail call; mail($to, $subject, $message, $headers); PHP: You might also want to look at using PEAR::Mail_Mime instead as recommended from the PHP reference.