How to send HTML format email in PHP

Welcome to Nepali Medium!

In this article I 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
<?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@nepalimedium.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; 
?>

I hope this article helped you learn how to Send HTML Format Email in PHP. 

Read More:How to Add Font Awesome Icons to WordPress Websites Menus

1 thought on “How To Send HTML Format Email in PHP”

Leave a Comment

Share via
Copy link
Powered by Social Snap