Home >>Advance PHP Tutorial >Sending HTML Email

Sending HTML Email

How to Send HTML Sturucture using mail fucntion

Second Part of the this tutorial i.e how to Send HTML Email using Php Mail() Function.


//Receiever of the mail

//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>

$headers .= "From:info@phptpoint.com";

$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.

No Sidebar ads