Friday, 22 October 2010

how to send html emails using PHP

$body = <<<EOF

<html><body>

<table width="100%" border="1" cellspacing="1" cellpadding="1">

  <tr>

    <th width="32%" scope="col">Q</th>

    <th width="68%" scope="col">A</th>

  </tr>

EOF;

 

$cont = "Content-Type: text/html; charset=ISO-8859-1\r\n";

 

if (mail($to, $subject, $body, $cont)) {

   echo("<p>Message successfully sent!</p>");

  } else {

   echo("<p>Message delivery failed...</p>");

  }

 

 

 

 

0 comments:

Post a Comment