Q:

html inside php mail

I have the following html codes for my email. 
$headers = "From: jmedalla20@gmail.com \r\n" .
   "MIME-Version: 1.0\r\n" .
   "Content-Type: text/html; charset=ISO-8859-1 \r\n"; 
$message = <<<EOD
<!DOCTYPE html>
<head>
<meta http-equiv=Content-Type content=text/html; charset=utf-8 />
<link rel=stylesheet type=text/css href=logo.jpg/>
</head>
<body>

<img src=../../img/logo.jpg style=left: 0;position: absolute; width: 75px;/>
<body style=padding: 0 0 0 100px;position: relative;>
{date(F d, Y )}  <br><br>

<b> {$row_Recordset1['First Name']}&nbsp{$row_Recordset1['Middle Initial']}&nbsp{$row_Recordset1['Last Name']}</b><br>
{$row_Recordset1['Position']}<br>{$row_Recordset1['Company Name']}<br>{$row_Recordset1['Corporate Address']}<br><br>

<p>Dear {$row_Recordset1['Last Name']}:</p>
// the rest of the letters
</body>
</html>
EOD;

I've had a few test runs and all that displays is 
{date(F d, Y )}

Dear :

I don't think the codes are being recognized. Any suggestions?
EDIT: The html is working. it's just the php codes which are not working I guess

A:

Yes, you cannot insert function calls like that. To insert the date, create a variable before this snippet of code that says $date = date(). Then you can use that variable in the string.
Apparently $row_Recordset1['Last Name'] is empty, doesn't exist, contains an empty string or whitespace or a piece of HTML. Hard to tell what exactly, since we don't have your data, nor the piece of code that assigns a value to $row_Recordset1.
Nevertheless, the e-mail is interpreted as HTML, or otherwise you would see chunks of HTML instead of merely this text. So that part is working well.

