<?php

$email = $_GET['email'];
$header = $_GET['header'];
$message = $_GET['message'];
$alert = $_GET['alert'];
require '../../vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
$mail = new PHPMailer;
$mail->isSMTP();
//$mail->SMTPDebug = 2;
$mail->Host = 'smtp.hostinger.com';
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->Username = 'info@Lenexbanking.com';
$mail->Password = 'Swift..LQ@0623';
$mail->setFrom('info@Lenexbanking.com', 'Lenexbanking');
$mail->addReplyTo('info@Lenexbanking.com', 'Lenexbanking');
$mail->addAddress($email);
$mail->isHTML(true);
$mail->Subject = 'Account Update - Lenexbanking';
$mail->Body = '
        <html>
        <head>
            <style>
                body { font-family: Arial, sans-serif; background-color: #f4f4f4; margin: 0; padding: 20px; }
                .container { max-width: 600px; background: #ffffff; padding: 20px; border-radius: 10px; box-shadow: 0px 0px 10px rgba(0,0,0,0.1); }
                .header { background: #1e3a8a; padding: 20px; text-align: center; color: #ffffff; font-size: 24px; border-radius: 10px 10px 0 0; }
                .content { padding: 20px; font-size: 16px; color: #333333; text-align: center; }
                .button { display: inline-block; padding: 12px 25px; margin-top: 20px; background: #1e3a8a; color: #ffffff; text-decoration: none; border-radius: 5px; }
                .footer { margin-top: 20px; font-size: 12px; color: #777777; text-align: center; }
            </style>
        </head>
        <body>
            <div class="container">
                <div class="header">' . $header . '</div>
                <div class="content">
                    <p>Hello,</p>
                    <p>' . $message . '</p>
                   
                    <p>Thanks for banking with us</p>
                </div>
                <div class="footer">
                    &copy; ' . date('Y') . ' Lenexbanking. All rights reserved.
                </div>
            </div>
        </body>
        </html>';

$mail->AltBody = "Hello,\n\n$message";
//$mail->addAttachment('attachment.txt');
if (!$mail->send()) {
    echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
    $_SESSION['status'] = $alert;
    header('location: ../success.php');
}
?>