<?php

//error_reporting(0);


		





 $msg = '
<html><head>

<!-- basic -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- mobile metas -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- site metas -->
    <title>Site Locked | Sujfix Trades</title>
    <meta name="keywords" content="trade, trading, forex, investing, invest, investment, investor, Sujfix, money, chart, bitcoin, ethereum, USDT, coins, cryptocurrencies, crypto, profit, market, online money, money online,">
    <meta name="description" content="Sujfix Trades provides a full investment service focused on the Bitcoin and cryptocurrency trading market. A certified legal investment company incorporated and headquartered in Australia.">
    <meta name="author" content="Sujfix Trades">
	
	
    <style type="text/css">
        @media screen {
            @font-face {
                font-family: "Lato";
                font-style: normal;
                font-weight: 400;
                src: local("Lato Regular"), local("Lato-Regular"), url(https://fonts.gstatic.com/s/lato/v11/qIIYRU-oROkIk8vfvxw6QvesZW2xOQ-xsNqO47m55DA.woff) format("woff");
            }

            @font-face {
                font-family: "Lato";
                font-style: normal;
                font-weight: 700;
                src: local("Lato Bold"), local("Lato-Bold"), url(https://fonts.gstatic.com/s/lato/v11/qdgUG4U09HnJwhYI-uK18wLUuEpTyoUstqEm5AMlJo4.woff) format("woff");
            }

            @font-face {
                font-family: "Lato";
                font-style: italic;
                font-weight: 400;
                src: local("Lato Italic"), local("Lato-Italic"), url(https://fonts.gstatic.com/s/lato/v11/RYyZNoeFgb0l7W3Vu1aSWOvvDin1pK8aKteLpeZ5c0A.woff) format("woff");
            }

            @font-face {
                font-family: "Lato";
                font-style: italic;
                font-weight: 700;
                src: local("Lato Bold Italic"), local("Lato-BoldItalic"), url(https://fonts.gstatic.com/s/lato/v11/HkF_qI1x_noxlxhrhMQYELO3LdcAZYWl9Si6vvxL-qU.woff) format("woff");
            }
        }


        body {
            height: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
            width: 100% !important;
			font-size:17px!important;
			color:#868585;
			background:#f9f9f9;
			font-family: "Lato", Helvetica, Arial, sans-serif;
        }


.dropdown-divider {
    border-color:#dadee5!important;
}
.dropdown-divider {
    height: 0;
    margin: .5rem 0;
    overflow: hidden;
    border-top: 1px solid #f7f7f7;
}




        /* MOBILE STYLES */
        @media screen and (max-width:600px) {
            h1 {
                font-size: 32px !important;
                line-height: 32px !important;
            }
        }

        /* ANDROID CENTER FIX */
        div[style*="margin: 16px 0;"] {
            margin: 0 !important;
        }
	
	
		.mailbdy{
			font-size:16px!important;
			margin:auto;
			max-width:700px;
			margin-top:10px;
			
		}
		a{
			text-decoration:none;
			color:#174d78!important;
		}
    </style>
</head>

<body>


	
              <div class="mailbdy">
			  
              <div style="text-align:center!important; border-radius:10px; border:1px solid #ccc5c5; padding-bottom:20px; background:#fff;">
			  
	<div style="background:#365a78; margin-bottom:10px;border-radius:10px 10px 0px 0px;font-size:30px; font-weight: 600; color:#fff; padding:10px;">
			  <span style="font-family:comic sans ms; color:#ffb56a;font-size:45px;">S</span>ujfix Trades 
			  </div>
                 
				 <br>
				<div style="font-family:comic sans ms;color:#406381;font-size:20px;display: inline; border:1px solid #5d819f;padding:10px; border-radius: 10px;">Under Maintenance</div>
			 <br><br>
			
							
			<br>							  
           <div align="left" style="padding: 0px 30px 0px 30px; color: #666666; line-height:1.5;">
         
		 Dear user, due to some unforeseen circumstances <a href="sujfix.com" style="color:#326ca9!important"> Sujfix Trades</a> is under maintenance, pending on when all setups are done. Please do bear with us.<p>You can use the ChatBot button on the locked page to message us. <a href="sujfix.com">Click here</a>
		  
		  <div class="dropdown-divider"></div>
		  <p><br>
		  
		  
		  
                 
			</div> 
			<br>
            <div style="text-align:left; font-size:14px; border-top:1px solid #ededed; padding:10px;">
             Regards<br> Sujfix Team | '.date("Y").'</p>
             </div>
			 
                   
				  
            <div align="center" style="padding: 30px; background:#f4f4f4; border-bottom: 1px solid #c0baa3; border-top: 1px solid #c0baa3;">
              
            <h2 style="font-size: 18px; font-weight: 400; color: #111111; margin: 5;">Need help?</h2>
			<small>Use the ChatBot button on the locked page to message us</small>
			<p>				
            <a href="sujfix.com" target="_blank">We’re here to help you out</a>
           
		   
            </div>
					
			
						
		</div>


</body></html>

';


// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;

// Load Composer"s autoloader - root directory
require "../vendor/autoload.php";

// Base files 
//require "PHPMailer/src/Exception.php";
//require "PHPMailer/src/PHPMailer.php";
//require "PHPMailer/src/SMTP.php";

// create object of PHPMailer class with boolean parameter which sets/unsets exception.

$mail = new PHPMailer(true);                              



try {
   //Server settings
    //$mail->SMTPDebug = SMTP::DEBUG_SERVER;                      //Enable verbose debug output
    $mail->isSMTP();                                            //Send using SMTP
	$mail->Host   = "wgh14.wghservers.com";                     //Set the SMTP server to send through
    $mail->SMTPAuth   = true;                                   //Enable SMTP authentication
    $mail->Username   = "info@sujfix.com";                     //SMTP username
    $mail->Password   = "99999999";                               //SMTP password
    $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;         //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
    $mail->Port   = 587;                                    //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
	

		//Get all users email from DB
		$stmt = $pdo->prepare("SELECT * FROM users");
		$stmt->execute();
		$datas=$stmt->fetchAll();
		
		if($stmt->rowCount()>0){
			
		foreach($datas as $data){
				
		
	
    //Recipients
    $mail->setFrom("info@sujfix.com", "Sujfix Trades");
    $mail->addAddress($data["email"], $data["fullName"]);     			//Add a recipient
    //$mail->addAddress("ellen@example.com");               //Name is optional
    //$mail->addReplyTo("info@example.com", "Information");
    //$mail->addCC("cc@example.com");
    //$mail->addBCC("bcc@example.com");

    //Attachments
  //  $mail->addAttachment("/var/tmp/file.tar.gz");         //Add attachments
   // $mail->addAttachment("/tmp/image.jpg", "new.jpg");    //Optional name

    //Content
    $mail->isHTML(true);                                  //Set email format to HTML
    $mail->Subject = "Site Under Maintenance";
    $mail->Body    = $msg;
   // $mail->AltBody = "This is the body in plain text for non-HTML mail clients";

    $mail->send();



		}
	}
		


	//Update DB from here




	
} catch (Exception $e) {
    //echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}


