Jump to content

putting html tables into mail()


NFWriter

Recommended Posts

I am butting my head against the wall trying to direct direct PHP variables into a table that is sent with the mail() command.

I find several examples on the web of intermixing PHP and HTML, including at w3school, but none of them work for me.

 

Here's an exercise that doesn't work, yet the example I lifted it from is very straightforward.

 

<?php

$headers = "MIME-Version: 1.0" . "\r\n";

$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

 

$message = <<<EOF

<html>

<body>

<table>

<tr>

Alabam Warehouse Web Order Request

Customer Info

</tr>

</table></body>

</html>

EOF;

mail("[email protected], [email protected]","Order/Quote from AWS web page",$message,"From: [email protected]");

header("location: http://alabamwhs.com/form42818/thankyou.html");

?>

-----------------------------------------------

 

should send html via PHP through email, but the output I get looks like this instead:

 

<html>

<body>

<table>

<tr>

Alabam Warehouse Web Order Request

Customer Info

</tr>

</table></body>

</html>

 

 

I'm at my wit's end to make ANY PHP and HTML work together. Any suggestions?

 

Jim

 

Link to comment
https://forums.phpfreaks.com/topic/133589-putting-html-tables-into-mail/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.