HTML tags in PHP mail function


<?php
$to = “[To Address]”;
$subject = “Mail with Details”;

$headers  = ‘MIME-Version: 1.0’ . \r\n;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . \r\n;

// Additional headers
$headers .= ‘To: AviWeb <To Address>’ . \r\n;
$headers .= ‘From: AviWeb <To address>’ . \r\n;
// Additional headers
$email_body = “<table width=\”721\” height=\”186\” border=\”0\” align=\”left\”>
<tr>
<td colspan=\”3\” style=\”background-color:#666666; color:#FFFFFF\” align=\”left\”><strong>Contact  – Us </strong></td>
</tr>
<tr><td>First Name : </td> <td>:</td> <td>Avinash</td><tr>
<tr><td>Email</td> <td>:</td> <td>To Address</td></tr>
<tr><td>Subject</td> <td>:</td> <td>”
.$subject.“</td></tr>
<tr><td valign=’top’>Comments</td> <td valign=’top’>:</td> <td>test</td></tr>

</table>”;

$message = “<html>
<head>
<title></title>
</head>
<body ><center>
.stripslashes($email_body).
</center>
</body>
</html>
;

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

?>

Advertisement

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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