<?php
function sendemail($to,$subject,$message){
$base_url = (!empty($_SERVER['HTTPS'])) ? "https://work.instasoft.co/workapp/console/" : "http://work.instasoft.co/workapp/console/";
$fromName="workapp";
$from="workapp@gmail.com";
// 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 .= 'From: '.$fromName.'<'.$from.'>' . "\r\n"; 
$htmlContent=' <!doctype html><html>
  <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width" />
    
    <title>'.$subject.'</title>
  </head>
  <body style=" background-color: #f6f6f6;font-family: sans-serif;-webkit-font-smoothing: antialiased;font-size: 14px;line-height: 1.4;margin: 0;padding: 0;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">   
         <div style="clear: both;margin-top: 10px;text-align: center;width: 100%;">
		 <p class="logo"><img src="'.$base_url.'image/logo.png" style="width:120px;"></p>      </div>
          <div  style=" box-sizing: border-box;display: block;margin: 10px auto;max-width: 580px;padding: 10px;background:#fff ">
            <!-- START CENTERED WHITE CONTAINER -->
           '.$message.'
            <!-- END CENTERED WHITE CONTAINER -->
          </div>
		    <!-- START FOOTER -->
		    <center><img src="'.$base_url.'image/android-app-on-google-play.png" style="width:120px;"></center>
            <div style="clear: both;margin: 10px 0px;text-align: center;width: 100%;display: grid;">
              <table role="presentation" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td class="content-block">
                    <span class="apple-link">Company Inc, Workapp,Chennai</span>
                    .
                  </td>
                </tr>
                <tr>
                  <td class="content-block powered-by">
                    Powered by <a href="'.$base_url.'">Workapp 2019</a>.
                  </td>
                </tr>
              </table>
            </div>
            <!-- END FOOTER -->
  </body>
</html>'; 
// Send email 
if(mail($to,$subject,$htmlContent, $headers)){ 
    //echo 'Email has sent successfully.'; 
}else{ 
   //echo 'Email sending failed.'; 
}    

}
?>