Widgets Send Email With HTML Template - Er Vinay Singh

Send Email With HTML Template

Send Email With HTML Template

If you send a textual content message utilizing PHP then all of the content material will probably be handled as easy textual content. Even when you’ll include HTML tags in a textual content message, will probably be displayed as easy textual content and HTML tags won’t be formatted according to HTML syntax. However PHP supplies choice to ship an HTML message as actual HTML message.

To send mail in HTML format you can specify a Mime version.

$to = '';
$subject = "Query From";

$visitor_email =$_POST['email'];
$name = $_POST['name'];
$mobile = $_POST['mobile'];
$message = $_POST['message'];
//echo $visitor_email;
$htmlContent = '
   <body style="background-color:#f9f9f9; padding: 15px;" >   
    <a href="" target="_blank"><img src="#" border="0"></a>
        <h2>Hi Admin,</h2>
        <h3>One of your customer has enquired with following details !</h3>
        <table cellspacing="0">
       <h4><strong>Thanks & Regards </strong></h4> 

// Set content-type header for sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// Additional headers
$headers .= '<>' . "\r\n";
$headers .= 'Cc:' . "\r\n";
//$headers .= 'Bcc:' . "\r\n";

// Send email
           //header ('location:index.php');
         echo "<script>
alert('Thank You,Email Sent Successfully. We will get back to you within 24 hrs.');
            echo "<script type='text/javascript'>alert('Faild!')</script>";

Leave a Comment