miinet Posted July 31, 2008 Share Posted July 31, 2008 I'm trying to figure out how to output my string, $message. I want the body of the e-mail to show a table with data. Right now it just shows First Name. Anyone know what I need to do to get it work right? <?php $to = "[email protected]"; $subject = "Request"; $headers = 'MIME-Version: 1.0' . "rn"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn"; $message = '<html> <head> <title>Confirmation</title> </head> <body> <table cellspacing="7"> <tr> <td>First Name:</td> </tr> <tr> <td>Last Name:</td> </tr> </table> </body> </html> '; //Send email mail($to,$subject,$message,$headers); ?> Link to comment https://forums.phpfreaks.com/topic/117579-solved-html-tables-dont-show-up-in-e-mail-message/ Share on other sites More sharing options...
mbeals Posted July 31, 2008 Share Posted July 31, 2008 try changing rn to \r\n. IE: $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html\r\n"; $headers .= "charset=iso-8859-1\r\n"; //probably should add a 'from' header too $headers = "From: $from\r\n"; [\code] Link to comment https://forums.phpfreaks.com/topic/117579-solved-html-tables-dont-show-up-in-e-mail-message/#findComment-604927 Share on other sites More sharing options...
miinet Posted August 1, 2008 Author Share Posted August 1, 2008 Thank you much! Link to comment https://forums.phpfreaks.com/topic/117579-solved-html-tables-dont-show-up-in-e-mail-message/#findComment-605234 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.