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

//Receiever of the mail $to=""; //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>
 <td>Test1</td> <td></td> </tr>
<td>Test2</td> <td></td> </tr>
<tr> <td>Test3</td> <td></td> </tr> </table>";
$headers .= ""; $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