<?php
    //include_once('../config.php'); 
	use PHPMailer\PHPMailer\PHPMailer;
    use PHPMailer\PHPMailer\Exception; 
	
	require_once '../PHPMailer_src/Exception.php';
	require_once '../PHPMailer_src/PHPMailer.php';
	require_once '../PHPMailer_src/SMTP.php';
 
    function SendMail($to,$subject,$message1,$template_type,$attachment)
    {			
        global $SITE_NAME;
        global $short_server;
        global $conn;
              
          
        $SCRIPT_URI=$_SERVER['SCRIPT_URI'];
        if($template_type==1) 
        { 
            
			 $messageNew  = "<!DOCTYPE html>
<html amp lang='en'><head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Daily Pay Services
</title>

</head>
<body>

 
<table style='max-width:600px;margin:auto;border-spacing:0;background:#138808;padding:4px;border-radius:16px;overflow:hidden' align='center' border='0' cellpadding='0' cellspacing='0' width='100%'>
   <tbody>
      <tr>
         <td style='border-collapse:collapse'>
            <table style='margin:auto;border-spacing:0;background:white;border-radius:12px;overflow:hidden' align='center' border='0' cellpadding='0' cellspacing='0' width='100%'>
               <tbody>
                  <tr>
                     <td style='border-collapse:collapse'>
                        <table style='border-spacing:0;border-collapse:collapse' bgcolor='#ffffff' border='0' cellpadding='0' cellspacing='0' width='100%'>
                           <tbody>
                              <tr>
                                 <td style='border-collapse:collapse;padding:16px 103px;background: #fff url(https://www.paykindia.com/images/headerbg.jpg) no-repeat; background-size: 100% 100%;' align='left' valign='middle'     >
                                    <table style='border-spacing:0;border-collapse:collapse' bgcolor='#ffffff' border='0' cellpadding='0' cellspacing='0' width='100%'>
                                       <tbody>
                                          <tr>
                                             <td style='padding:0;text-align:left;border-collapse:collapse' width='140' align='left' valign='middle'> &nbsp;                    
                                             </td>
                                             <td width='16' align='left' valign='middle' style='border-collapse:collapse;text-align:center;'>                                                <a href='https://www.dailypayservices.in' style='text-decoration:none;color:#ffffff;outline:0;outline:none;border:0;border:none' rel='noreferrer' target='_blank' data-saferedirecturl='' title='".$SITE_NAME."' alt='".$SITE_NAME."'  style='margin:auto;text-align:center;border:0;outline:none;text-decoration:none;min-height:40px' align='middle' border='0' width='40' class='CToWUd'><img src='https://www.dailypayservices.in/mob/view/images/car1.png' title='".$SITE_NAME."' alt='".$SITE_NAME."' style='margin:auto;text-align:center;border:0;outline:none;text-decoration:none;min-height:40px' align='middle' border='0'   class='CToWUd'>                     </a>             
</td>
                                             <td align='right' valign='middle'>&nbsp;</td>
                                          </tr>
                                       </tbody>
                                    </table>
                                 </td>
                              </tr>
                           </tbody>
                        </table>
                     </td>
                  </tr>
                  $message1
                  <tr>
                     <td style='border-collapse:collapse;padding:32px 18px;background:#ffffff;'>
                        <p style='padding:0;margin:0'>Kindly conatct us at https://www.dailypayservices.in for any issues arise. <br><br>Regards!<br>Team Daily Pay</p>
                     </td>
                  </tr>
                  <tr>
                     <td style='border-collapse:collapse;padding:16px 18px;border-top:1px solid #eaeaed;'>
                        <table align='center' border='0' cellpadding='0' cellspacing='0' width='100%'>
                           <tbody>
                              <tr>
                                 <td align='left' valign='middle' style='border-collapse:collapse;font-weight:normal'>                     
                                    <a href='#' style='color:#673ab7;font-size:12px;padding:4px;height:24px;display:inline-block;text-transform:capitalize;outline:0;outline:none;border:0;border:none' rel='noreferrer' target='_blank' data-saferedirecturl='#'>About us</a>                     
									<a href='#' style='color:#673ab7;font-size:12px;padding:4px;height:24px;display:inline-block;text-transform:capitalize;outline:0;outline:none;border:0;border:none' rel='noreferrer' target='_blank' data-saferedirecturl='#'>Policy</a>                     
									<a href='#' style='color:#673ab7;font-size:12px;padding:4px;height:24px;display:inline-block;text-transform:capitalize;outline:0;outline:none;border:0;border:none' rel='noreferrer' target='_blank' data-saferedirecturl='#'>Terms</a>                 
                                 </td>
                                 <td width='16' align='left' valign='middle' style='border-collapse:collapse'>&nbsp;</td>
                                 <td align='right' valign='middle' style='border-collapse:collapse;padding:0px 18px'>
                                    <table border='0' cellspacing='0' cellpadding='0'>
                                       <tbody>
                                          <tr>
                                             <td style='border-collapse:collapse'>                             
                                                <a href='#' style='font-size:0;border:0;outline:0;border:none;outline:none;text-decoration:none;margin-right:4px' rel='noreferrer' target='_blank' data-saferedirecturl='#'>                             
                                                <img width='24' src='https://www.paykindia.com/view/images/facebook-logo-mail.png' title='Facebook' alt='Facebook' class='CToWUd'></a>                             
                                                <a href='#' style='font-size:0;border:0;outline:0;border:none;outline:none;text-decoration:none;margin-right:4px' rel='noreferrer' target='_blank' data-saferedirecturl='#'>                             
                                                <img width='24' src='https://www.paykindia.com/view/images/twitter-logo-mail.png' title='Twitter' alt='Twitter' class='CToWUd'></a>
                                             </td>
                                          </tr>
                                       </tbody>
                                    </table>
                                 </td>
                              </tr>
                              <tr>
                                 <td style='border-collapse:collapse;font-weight:normal;padding-top:16px;font-style:italic;color:#7e818c' colspan='3'>                  
                                     
                                 </td>
                              </tr>
                           </tbody>
                        </table>
                     </td>
                  </tr>
               </tbody>
            </table>
         </td>
      </tr>
   </tbody>
</table>
</body>
</head>
</html>";

		
        }
        
        
               
        	
			$from = "noreply@dailypayservices.in";    
			$headers  = "From: $from\r\n";
    		$headers .= "Content-type: text/html\r\n";     
    		$Ticket_data=$messageNew;    
    	 
    		
    		$SITE_NAME = "Daily Pay";
			$mail = new PHPMailer;
            $mail->isSMTP();
            $mail->Host = 'localhost';//'sg2nlvphout-v01.shr.prod.sin2.secureserver.net';//'localhost';
            $mail->SMTPAuth = false;
            $mail->SMTPAutoTLS = false; 
            $mail->Port = 25;
            $mail->Username = $mail_username;
            $mail->Password = $mail_password;
            $mail->setFrom("noreply@dailypayservices.in", "Daily Pay"); 
            $mail->addAddress($to, "User");
            $mail->Subject = $subject;
            $mail->msgHTML($Ticket_data); // remove if you do not want to send HTML email 
            $mail->send();   
    }
?>