Home >>Advance PHP Tutorial >Sending HTML Email
Second Part of the this tutorial i.e how to Send HTML Email using Php Mail() Function.
<?php //Receiever of the mail $to="[email protected]"; //subject of the mail $subject = "ProductDetails"; //message of the mail which contains some html $message =" <table width='400' border='1'> <tr bgcolor='#CCCCCC'> <th>Name </th> <th>Email</th> </tr> <tr> <td>rajeev</td> <td>[email protected]</td> </tr> <tr> <td>ravi</td> <td>[email protected]</td> </tr> <tr> <td>rexx</td> <td>[email protected]</td> </tr> </table>"; $headers .= "From:[email protected]"; $headers .= "Content-type: text/html; charset=iso-8859-1rn"; mail($to, $subject, $message, $headers); echo $message; ?>
in above example , a proper tabular format is sent to receiver . To do this we have to make changes in header and add content type . Receiver will receive tabular format not the HTML code of mail.