<?php
require_once 'main.php';
session_write_close();
// Output message
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
$_SESSION['year'] = date("Y");

$msg = '';

// Now we check if the data from the login form was submitted, isset() will check if the data exists.
if (isset($_SESSION['welcome_email'])) {
    // Prepare our SQL, preparing the SQL statement will prevent SQL injection.
    $stmt = $pdo->prepare('SELECT * FROM Users WHERE email = ?');
    $stmt->execute([ $_SESSION['welcome_email'] ]);
    $account = $stmt->fetch(PDO::FETCH_ASSOC);
    // If the account exists with the email
    if ($account) {
        // Account exist, the $msg variable will be used to show the output message (on the HTML form)
        // Update the reset code in the database
    $uniqid = uniqid();
        $stmt = $pdo->prepare('UPDATE Users SET reset = ? WHERE email = ?');
      $stmt->execute([ $uniqid, $_SESSION['welcome_email'] ]);
      $stmt = $pdo->prepare("SELECT * FROM EmailSetting WHERE Id ='1'");
        $stmt->execute();
        $emailSetting = $stmt->fetch(PDO::FETCH_ASSOC);
        // Email to send below, customize this
      $subject = 'Welcome Email';
        $reset_link = $emailSetting['Loginbutton'] . '/welcomeemail.php?email=' . $_SESSION['welcome_email'] . '&code=' . $uniqid;
      // Feel free to customize the email message below
      $message = '<p>Please click the following link to reset your password: <a href="' . $reset_link . '">' . $reset_link . '</a></p>';
        // Send email to the user
        

        $password = decrypt($emailSetting['Password'], "SmartVisionSystem");

        $date = date('Y-m-d\TH:i:s');
        $start = $date;
        $date =  'UTC ' . $account['TimeZone'] . ': ' . date('Y-m-d H:i:s',strtotime($account['TimeZone'] . 'hour',strtotime($start)));

        $name = $emailSetting['Name'];
        $email = $emailSetting['Email'];
        $subject = 'Welcome to Smart Vision System';
        $body = '
              
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head><base target="_blank">
<title>Welcome to Smart Vision System</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
<link href="https://fonts.googleapis.com/css?family=Sarala:400,700|Open+Sans:400,800italic,800,700italic,700,600italic,600,400italic,300italic,300|Raleway:400,200,100,300,500,600,700,800,900|Playfair+Display:400,400italic,700,700italic,900,900italic|Lato:400,100italic,100,300,300italic,400italic,700,700italic,900,900italic|Nunito|Questrial" rel="stylesheet" type="text/css">

<style type="text/css">

td[class].opensans {font-family: \'Open Sans\', Arial, sans-serif !important}
td[class].raleway {font-family: \'Raleway\', Arial, sans-serif !important}
td[class].lato {font-family: \'Lato\', Arial, sans-serif !important}
td[class].nunito {font-family: \'Nunito\', Arial, sans-serif !important}
td[class].questrial {font-family: \'Questrial\', Arial, sans-serif !important}

div, p, a, li, td { -webkit-text-size-adjust:none; }

*{-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}
td{word-break: break-word;}
a{word-break: break-word; text-decoration: none; color: inherit;}

body .ReadMsgBody
{width: 100%; background-color: #ffffff;}
body .ExternalClass
{width: 100%; background-color: #ffffff;}
body{width: 100%; height: 100%; background-color: #ffffff; margin:0; padding:0; -webkit-font-smoothing: antialiased;}
html{ background-color:#ffffff; width: 100%;}

body p {padding: 0!important; margin-top: 0!important; margin-right: 0!important; margin-bottom: 0!important; margin-left: 0!important; }
body img {user-drag: none; -moz-user-select: none; -webkit-user-drag: none;}
body a.rotator img {-webkit-transition: all 1s ease-in-out;-moz-transition: all 1s ease-in-out; -o-transition: all 1s ease-in-out; -ms-transition: all 1s ease-in-out; }
body a.rotator img:hover {-webkit-transform: rotate(360deg); -moz-transform: rotate(360deg); -o-transform: rotate(360deg);-ms-transform: rotate(360deg); }
body .hover:hover {opacity:0.85;filter:alpha(opacity=85);}
body .jump:hover {opacity:0.75; filter:alpha(opacity=75); padding-top: 10px!important;}

#opacity {filter: alpha(opacity=20); opacity: 0.20;}
#opacity2 {opacity: 0.90;}
#opacity3 {opacity: 0.70;}

body .img20 img {width: 20px; height: auto;}
body .img12 img {width: 12px; height: auto;}
body .img106 img {width: 106px; height: auto;}
body .img150 img {width: 150px; height: auto;}
body .img600 img {width: 600px; height: auto;}
body .img275 img {width: 275px; height: auto;}
body .img24 img {width: 24px; height: auto;}
body .img110 img {width: 110px; height: auto;}
body .img127 img {width: 127px; height: auto;}
body .img33 img {width: 33px; height: auto;}
body .img190 img {width: 190px; height: auto;}
body .img175 img {width: 175px; height: auto;}
body .img170 img {width: 170px; height: auto;}
body .img32 img {width: 32px; height: auto;}
body .img283 img {width: 282px; height: auto;}
body .img290 img {width: 290px; height: auto;}
body .img71 img {width: 71px; height: auto;}
body .img92 img {width: 92px; height: auto;}
body .img277 img {width: 277px; height: auto;}
body .img17 img {width: 17px; height: auto;}
body .img290 img {width: 290px; height: auto;}
body .img405 img {width: 100%; height: auto;}
body .img252 img {width: 252px; height: auto;}
body .img289 img {width: 289px; height: auto;}
body .img19 img {width: 19px; height: auto;}
body .img75 img {width: 75px; height: auto;}
body .img16 img {width: 16px; height: auto;}


</style>

<style type="text/css">@media only screen and (max-width: 640px){
    body body{width:auto!important;}
    body table[class=full] {width: 100%!important; clear: both; }
    body table[class=mobile] {width: 100%!important; padding-left: 30px; padding-right: 30px; clear: both; }
    body table[class=fullCenter] {width: 100%!important; text-align: center!important; clear: both; }
    body td[class].fullCenter {width: 100%!important; text-align: center!important; clear: both; }
    body *[class=erase] {display: none;}
    body *[class=buttonScale] {float: none!important; text-align: center!important; display: inline-block!important; clear: both;}
    body .buttonScale2 {float: none!important; text-align: center!important; display: inline-block!important; clear: both;}
    body *[class=h10] {width: 100%!important; height: 10px!important;}
    body *[class=h20] {width: 100%!important; height: 20px!important;}
    body *[class=h30] {width: 100%!important; height: 30px!important;}
    body *[class=h40] {width: 100%!important; height: 40px!important;}
    body td[class].h50 {width: 100%!important; height: 50px!important;}
    body td[class].pad20 {padding-left: 20px!important; padding-right: 20px!important; text-align: center!important; clear: both;}
    body .img600 img {width: 100%!important;}
    body .img190 img {width: 100%!important;}
    body .img252 img {width: 100%!important;} 
    body table[class=full2] {width: 100%!important; clear: both;}
    body td[class].fullCenterMob {width: 100%!important; text-align: center!important; clear: both; }
    body .image405 img {width: 90%!important;}    
    body .premadeFullScale img{width:100%!important;} 

}</style>

<style type="text/css">@media only screen and (max-width: 479px){ 
    body body{width:auto!important;}
    body table[class=full] {width: 100%!important; clear: both; }
    body table[class=mobile] {width: 100%!important; padding-left: 20px; padding-right: 20px; clear: both; }
    body table[class=fullCenter] {width: 100%!important; text-align: center!important; clear: both; }
    body td[class].fullCenter {width: 100%!important; text-align: center!important; clear: both; }
    body *[class=erase] {display: none;}
    body *[class=buttonScale] {float: none!important; text-align: center!important; display: inline-block!important; clear: both;}  
    body .buttonScale2 {width: 100%!important; text-align: center!important; clear: both;}
    body *[class=h10] {width: 100%!important; height: 10px!important;}
    body *[class=h20] {width: 100%!important; height: 20px!important;}
    body *[class=h30] {width: 100%!important; height: 30px!important;}
    body *[class=h40] {width: 100%!important; height: 40px!important;}
    body td[class].h50 {width: 100%!important; height: 50px!important;}
    body td[class].pad20 {padding-left: 20px!important; padding-right: 20px!important; text-align: center!important; clear: both; }
    body .img600 img {width: 100%!important;}
    body .img290 img {width: 100%!important;}
    body .img190 img {width: 100%!important;}
    body .img175 img {width: 100%!important;}
    body .img290 img {width: 100%!important;}
    body .img252 img {width: 100%!important;}
    body table[class=full2] {width: 100%!important; clear: both; }
    body td[class].fullCenterMob {width: 100%!important; text-align: center!important; clear: both; }
    body .img405 img {width: 90%!important;}
    body .img405 img .premadeFullScale img{width:100%!important;}
    
}</style>

</head>
<body style=\'margin: 0; padding: 0;\'>

<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full" bgcolor="rgb(255, 0, 0)" style="background-color: rgb(255, 0, 0); pointer-events: auto; top: 0px; left: 0px;"></table><table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full" bgcolor="rgb(255, 0, 0)" style="background-color: rgb(255, 0, 0); pointer-events: auto; top: 0px; left: 0px;"></table><table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full" bgcolor="rgb(255, 0, 0)" style="background-color: rgb(255, 0, 0); pointer-events: auto; top: 0px; left: 0px;">
  <tbody ><tr>
    <td align="center" valign="top">
    
      <table class="full" align="center" border="0" width="100%" cellpadding="0" cellspacing="0">
        <tbody><tr>
          <td width="100%" height="20" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
        </tr>
        <tr>
          <td align="center" class="pad20">
          
            <!-- Start Nav -->
            <table width="600" border="0" cellpadding="0" cellspacing="0" align="center" class="full">
              <tbody><tr>
                <td width="100%" valign="middle" align="center">
                  
                  <table width="230" border="0" cellpadding="0" cellspacing="0" align="left" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;" class="fullCenter">
                    <tbody><tr>
                      <td height="60" valign="middle" align="left" width="100%" class="fullCenter h50 img150" style="line-height: 1px;">
                        <a style="text-decoration: none;"> 
                          <img src="' . $emailSetting['Loginbutton'] . '/assets/images/logo/PACO-LOGO-small-white.png" editable="true" width="140" alt="" border="0" class="hover toModifyImage">
                        </a>
                      </td>
                    </tr>
                  </tbody></table>
                  
                  <table width="140" border="0" cellpadding="0" cellspacing="0" align="left" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; text-align: center;" class="fullCenter">
                    <tbody><tr>
                      <td height="100%" align="center" class="img20">
                  
                        <table width="140" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; text-align: center;" class="buttonScale">
                          <tbody><tr>
                            <td height="30" width="20" class="">
                              <a href="#" style="text-decoration: none;">
                                
                              </a>
                            </td>
                            <td width="10" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
                            <td width="20" class="">
                              <a href="#" style="text-decoration: none;">
                                
                              </a>
                            </td>
                            <td width="10" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
                            <td width="20" class="">
                              <a href="#" style="text-decoration: none;">
                                
                              </a>
                            </td>
                            <td width="10" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
                            <td width="20" class="">
                              <a href="#" style="text-decoration: none;">
                                
                              </a>
                            </td>
                            <td width="10" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
                            <td width="20" class="">
                              <a href="#" style="text-decoration: none;">
                                
                              </a>
                            </td>
                          </tr>
                        </tbody></table>
                        
                      </td>
                    </tr>
                    <tr>
                      <td width="100%" height="0" class="h20" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
                    </tr>
                  </tbody></table>
                
                  <table border="0" cellpadding="0" cellspacing="0" align="right" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;" class="buttonScale">
                    <tbody><tr>
                      <td height="30" align="right" class="img12">
                        <a href="#" style="text-decoration: none;"> 
                          
                        </a>
                      </td>
                      <td width="6"></td>
                      <td align="center" style="font-family: Helvetica, Arial, sans-serif, \'Open Sans\'; color: #ffffff; font-weight: 700; font-size: 18px; line-height: 24px; padding-bottom: 2px;" class="opensans">
                        <multiline><a href="#" style="text-decoration: none; color: #ffffff;"><strong>Smart Vision System<br></strong><span style="font-size: 18px; font-family: Raleway, \'Century Gothic\', CenturyGothic, AppleGothic, sans-serif; color: #eeeeee; text-align: center;" >Welcome</span></a></multiline>
                      </td>
                    </tr>
                  </tbody></table>
                  
                                  
                </td>
              </tr>
            </tbody></table>
            
          </td>
        </tr>
        <tr>
          <td width="100%" height="20" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
        </tr>
      </tbody></table>
      
    </td>
  </tr>
<!--—EndModule--></tbody>  </table><table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255);">
  <tbody ><tr>
    <td width="100%" valign="top" align="center">
      
      <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="mobile">
        <tbody><tr>
          <td align="center">
            
            <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full">
              <tbody><tr>
                <td width="100%" height="60" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
              </tr>
            </tbody></table>
            
            <table width="600" border="0" cellpadding="0" cellspacing="0" align="center" class="full">
              <tbody><tr>
                <td width="100%" align="center" class="image600">
                
                  <table width="600" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;" class="fullCenter">
                  
                    <tbody><tr>
                      <td width="100%" style="color: #3d3d3d; font-family: Helvetica, Arial, sans-serif, \'Questrial\'; font-weight: 400; vertical-align: top; font-size: 18px; text-align: left; line-height: 24px;" class="questrial fullCenter">
                        <span style="font-size: 16px; font-family: \'Open Sans\', Arial, sans-serif; color: #7e8c8d;" >Hi ' . $account['fullname']  . ',</span>
                      </td>
                    </tr>
                    <tr>
                      <td width="100%" height="15" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
                    </tr>
                    <tr>
                      <td width="100%" style="color: #ababab; font-family: Helvetica, Arial, sans-serif, \'Open Sans\'; font-weight: 400; vertical-align: top; font-size: 14px; text-align: left; line-height: 24px;" class="opensans fullCenter">
                        <span style="font-size: 16px; color: #7e8c8d;" >Welcome to Smart Vision System. Your admin sent you a reset password link on ' . $date . ', if you didn\'t have one. <br /><br />If you didn\'t expect this email, please call us at 1 888 796 7278 (at working hours) and we will be happy to help.<br><br>username: <b>' .$account['UserName'].'</b></span>
                      </td>
                    </tr>

                    <tr>
                      <td width="100%" height="30" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
                    </tr>
                    <tr>
                    
                      <td align="left" class="buttonScale">
                        
                        <table border="0" cellpadding="0" cellspacing="0" align="left" class="buttonScale repeaterFull" style="font-size: 1px!important; line-height: 1px!important; padding: 0px!important;">
                          <tbody><tr> 
                            <td align="center" height="42" bgcolor="rgb(249, 0, 1)" style="border-radius: 4px; padding-left: 35px; padding-right: 35px; padding-bottom: 1px; font-weight: 600; font-family: Helvetica, Arial, sans-serif, \'Open Sans\'; color: rgb(255, 255, 255); font-size: 14px; text-transform: uppercase; line-height: 20px; background-color: rgb(249, 0, 1);" class="opensans">
                              <multiline><a href="' . $reset_link . '" style="color: #ffffff; text-decoration: none;">Create/Change Password</a></multiline>
                            </td> 
                          </tr>  
                        </tbody></table> 
                      </td>
                    </tr>
                  </tbody></table>
                  
                </td>
              </tr>
            </tbody></table>
            
            <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full">
              <tbody><tr>
                <td width="100%" height="30" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
              </tr>
            </tbody></table>
            
          </td>
        </tr>
      </tbody></table>
    
    </td>
  </tr>
<!--—EndModule--></tbody> </table>

<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255); pointer-events: auto; top: 0px; left: 0px;">
  <tbody ><tr>
    <td width="100%" valign="top" align="center">
      
      <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full">
        <tbody><tr>
          <td align="center">
            
            <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full">
              <tbody><tr>
                <td width="100%" height="30" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
              </tr>
              <tr>
                <td width="100%" height="1" bgcolor="#f0f0f0" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
              </tr>
              <tr>
                <td width="100%" height="30" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
              </tr>
            </tbody></table>
            
          </td>
        </tr>
      </tbody></table>
    
    </td>
  </tr>
</tbody></table><table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255); pointer-events: auto; top: 0px; left: 0px;">
  <tbody ><tr>
    <td width="100%" valign="top" align="center">
    
      <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="mobile">
        <tbody><tr>
          <td align="center">
          
            <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full">
              <tbody><tr>
                <td width="100%" height="0" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
              </tr>
            </tbody></table>
            
            <table width="600" border="0" cellpadding="0" cellspacing="0" align="center" class="full">
              <tbody><tr>
                <td width="100%" align="center">
                  
                  <table width="600" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;" class="fullCenter">
                    <tbody><tr>
                      <td valign="bottom" style="text-align: center; font-family: Helvetica, Arial, sans-serif, \'Open Sans\'; font-size: 12px; color: #ababab; line-height: 20px; font-weight: 400;" class="opensans">
                        <p style="text-align: left;" ><span style="color: #7e8c8d;" >Panacea Aftermarket Co.<br>555 Hanlan Road Unit 5<br>Toronto ON L4L 4R8<br>Canada<br><a href="https://paco1.com/" >paco1.com</a><br><br> © Panacea Aftermarket Co ' . $_SESSION['year'] .  '</span></p><p style="text-align: left;" ><span style="color: #7e8c8d;" ><strong></strong></span><br></p><p style="text-align: left;" ><span style="color: #7e8c8d;" ><strong></strong></span><br></p><p style="text-align: left;" ><span style="color: #7e8c8d;" ><strong>Communicating Safely Online</strong><br>Regular, unencrypted email is not secure. You should never include personal or confidential information in a regular email. Be careful when opening messages, links or attachments received through digital channels, including regular emails, text messages and social media messages. If you receive a message that appears to be from Panacea Aftermarket Co. that is suspicious please report it to us and then delete it. Do not provide personal information like passwords.<br><br>Please note this email was sent from an unmonitored inbox. Do not reply.</span></p>
                      </td>
                    </tr>
                    <tr>
                      <td valign="bottom" style="text-align: center; font-family: Helvetica, Arial, sans-serif, \'Open Sans\'; font-size: 13px; color: #6cbf89; line-height: 22px; font-weight: 700;" class="opensans">
                        <a href="#" style="color: #6cbf89; text-decoration: none;"></a>
                      </td>
                    </tr>
                  </tbody></table>
                  
                </td>
              </tr>
            </tbody></table>
            
            <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full">
              <tbody><tr>
                <td width="100%" height="30" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
              </tr>
            </tbody></table>
            
          </td>
        </tr>
      </tbody></table>
    </td>
  </tr>
</tbody></table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="full" bgcolor="rgb(255, 255, 255)" style="background-color: rgb(255, 255, 255);">
  <tbody ><tr>
    <td align="center" valign="top">
    
      <table class="full" align="center" border="0" width="100%" cellpadding="0" cellspacing="0">
        <tbody><tr>
          <td width="100%" height="0" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
        </tr>
        <tr>
          <td align="center" class="pad20">
          
            <!-- Start Nav -->
            <table width="600" border="0" cellpadding="0" cellspacing="0" align="center" class="full">
              <tbody><tr>
                <td width="100%" valign="middle" align="center" class="img170">
                  
                  <table width="600" border="0" cellpadding="0" cellspacing="0" align="left" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;" class="fullCenter">
                    <tbody><tr>
                      <td height="0" valign="middle" align="center" width="100%" class="fullCenter" style="line-height: 1px;">
                        <a style="text-decoration: none;"> 
                          <img src="' . $emailSetting['Loginbutton'] . '/assets/images/logo/PACO-LOGO.png" editable="true" width="150" alt="" border="0" class="hover toModifyImage" >
                        </a>
                      </td>
                    </tr>
                  </tbody></table>
                                  
                </td>
              </tr>
            </tbody></table>
            
          </td>
        </tr>
        <tr>
          <td width="100%" height="15" style="font-size: 1px; line-height: 1px;">&nbsp;</td>
        </tr>
      </tbody></table>
      
    </td>
  </tr>
<!--—EndModule--></tbody> </table><!--—EndPremade-->


<!-- This is an Android Fix, do not delete it -->
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" class="full">
  <tbody><tr>
    <td width="100%" align="center" class="fullCenter">     
      <table width="600" align="center" border="0" cellpadding="0" cellspacing="0" class="full" style="width: 600px;">
        <tbody><tr>
          <td align="center">           
            <table align="center" class="full" width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed;">
              <tbody><tr>
                <td class="erase" style="line-height:1px; font-size:1px;" width="600"><img src="images/transparant.png" height="1" style="max-height:1px; min-height:1px; display:block; width:600px; min-width:600px;" border="0"></td>
              </tr>
            </tbody></table>            
          </td>
        </tr>
      </tbody></table>      
    </td>
  </tr>
</tbody></table>
<!-- End this is an Android Fix, do not delete it -->


        ';


        require_once "PHPMailer/PHPMailer.php";
        require_once "PHPMailer/SMTP.php";
        require_once "PHPMailer/Exception.php";

        $mail = new PHPMailer();

        //SMTP Settings
        $mail->isSMTP();
        $mail->Host = $emailSetting['SMTPserver'];
        $mail->SMTPAuth = true;
        $mail->Username = $emailSetting['Username']; //enter you email address
        $mail->Password = $password; //enter you email password
        $mail->Port = $emailSetting['Port'];

        if ($emailSetting['SMTPSecure'] == "SSL") {
          $mail->SMTPSecure = "ssl";
        }
        
        //Email Settings
        $mail->isHTML(true);
        $mail->setFrom($email, $name);
        $mail->addAddress($_SESSION['welcome_email']); //enter you email address
        $mail->Subject = ("$subject");
        $mail->Body = $body;

        if ($mail->send()) {
            $status = "success";
            $response = "Email is sent!";
            $_SESSION['responds'] = $response;
        } else {
            $status = "failed";
            $response = "Something is wrong: <br><br>" . $mail->ErrorInfo;
        }

        $msg = 'Reset password link has been sent to your email if your email registered';



    } else {
        $msg = 'Reset password link has been sent to your email if your email registered';
    }
}