Like Us on Facebook

How to Send Mail with HTML Template using PHP

Today our topic about How to Send Mail with Email or HTMLTemplate using PHP . In this section we have already discussed how to send mail which is only some text but in this post i am going discuss how send email with HTML templates, which is also called email template. Also in download section you can download full source code of HTML template but our focus is how to send this template as mail using PHP.


<form action="#" id="ContactForm" method="post" enctype="multipart/form-data">
        <table border="0" cellspacing="5" cellpadding="5" style="background-color:#CCCCCC; text-align:center;">
                 <td width="15%">Name:</td>
                 <td width="85%">
<input name="name" type="text" required></td>
<input name="email" type="email" required></td>
                 <td colspan="2">
<input name="sub" type="submit" value="Submit"></td>


error_reporting(E_ALL && ~E_NOTICE);


        $to=$email; //change to ur mail address
        $subject="UandBlog - Send Email Template Demo";
        $message =  file_get_contents('Your template path');  Your Template
        $headers = 'MIME-Version: 1.0'."\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
        $headers .= "From:"; 
        mail($to, $subject, $message, $headers);  // Mail Function


Posted By UandBlog

UandBlog is a Global Leading source of Finance, Health, Lifestyle, Technology, Gaming and Programing and other information, it is a fastest growing blog for all , for latest post or information like us on facebook , follow on Twitter, Google+ and Pinterest.

Comments ( 0 )

    Leave a comment..

    Click to login.