<?php
session_start();
include '../../assets/constant/config.php';

try {
    $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

   
    





    // delete Email..

    if (isset($_POST['del_id'])) {

        $stmt = $conn->prepare("UPDATE `send_email` SET delete_status='1' where id=? ");

        $stmt->execute([htmlspecialchars($_POST['del_id'], ENT_QUOTES, 'UTF-8')]);

        $_SESSION['delete'] = "delete";

        header("location:../manage_mail.php");
    }
} catch (PDOException $e) {
    echo "Connection failed: " . $e->getMessage();
}
