How To Send HTML Format Email in PHP

Welcome to pinepl, in this article we will show you how to send HTML format email using PHP, generally PHP send plain text email it’s can’t send any formatting or graphics by default so, send the email with HTML it’s the best way to send formatting email so let’s start today article.


//Send HTML Email Using PHP - Veewom
<?php

//Receiever of the mail
$to="username@example.com";
//subject of the mail
$subject = "Test Email";

//message of the mail which contains some html 
$message ="
<table width='800' border='1'>
  <tr bgcolor='#CCCCCC'>
    <th>Name </th>
    <th>Email</th>
  </tr>
  <tr>
    <td>Test1</td>
    <td>test1@veewom.com</td>
  </tr>
  <tr>
    <td>Test2</td>
    <td>test2@yahoo.com</td>
  </tr>
  <tr>
    <td>Test3</td>
    <td>test3@gmail.com</td>
  </tr>
</table>";

$headers .= "From:noreply@veewom.com";
$headers .= "Content-type: text/html; charset=iso-8859-1rn";
mail($to, $subject, $message, $headers);
echo $message;
?>

We hope this article helped you learn how to Send HTML Format Email in PHP. You may also want to see – How To Change The Default WordPress Email Address.

If you liked this article, then please share to social networking site. You can also find us on Twitter,Facebook and Instagram.

Share Share on Facebook Share on Twitter Share on Google+ Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

Bharat Makwana is a Founder of Veewom. He is Content creator and Web Developer from past three years. He loves to read and get in touch with the latest technology, he also have YouTube Channel ” Veewom ” ,for more info contact - bharat@veewom.com.