Robert Granlund
asked on
PHP If statement within HTML Email
How do I add PHP code into an HTML email that is sent out via PHP?
The following does not work:
The following does not work:
$to = 'ME@ME.com';
$subject = 'MY SUBJECT';
$headers = "From: ME\r\n";
$headers .= "Reply-To: help@ME.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = '<html><body>';
$message .= '<h1>Thank you for your purchase</h1>
<table>
<tr>
<td>TD Image One ONE</td>
<td>TD Image TWO </td>
</tr>
<tr>
<td><img src="MY-IMAGE/GC-25.jpg"/></td>
<td>';
if ($item-name=="CI50") {
echo '<img src="MY-IMAGEGC-50.jpg"/><br />'.$gon;
} else {
echo 'No Image Available';
}
echo '</td>
</tr>
</table>';
$message .= '</html></body>';
mail($to, $subject, $message, $headers);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Gmail blocks <style> tags completely and more block style <links>. See here: http://www.campaignmonitor.com/css/ Inline styles are supported to varying degrees.
ASKER
On another note, in an HTML email sent out via PHP where do I place the <style>? In the header?