php dynamic email format

$to = ‘’;
$subject = ‘My Email’;
$msg = “<html>
<title>Title of email</title>

<p align=’center’> <img src=’; width=’210′ height=’45’> </p>

<table cellspacing=\”4\” cellpadding=\”4\” border=\”1\” align=\”center\”>

<td align=\”center\”>Name</td>
<td align=\”center\”> John</td>
<td align=\”center\”>Age</td>
<td align=\”center\”>20</td>

<td align=\”center\”>Empid</td>
<td align=\”center\”>0014 </td>
<td align=\”center\”>Depart</td>
<td align=\”center\”>IT</td>

<td align=\”center\”>Salary</td>
<td align=\”center\”>20000</td>
<td align=\”center\”>Country</td>
<td align=\”center\”>US</td>


// Make sure to escape quotes

$headers = ‘MIME-Version: 1.0’ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “\r\n”;
$headers .= ‘From: My Site Name <>’ . “\r\n”;

mail($to, $subject, $msg, $headers);



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s