<?php
// Email recipient
$to = "babatundem651@gmail.com";

// Subject of the email
$subject = "HTML Structured Email";

// Path to your HTML file
$htmlFile = "index.php";

// Get the content of the HTML file
$message = file_get_contents($htmlFile);

// Set the content-type header to ensure email is sent as HTML
$headers  = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// Additional headers
$headers .= 'From: no-reply@springmed.com.ng' . "\r\n";  // Sender's email
$headers .= 'Reply-To: support@darknnet.com' . "\r\n";  // Reply-to email
$headers .= 'X-Mailer: PHP/' . phpversion();

// Send the email
if(mail($to, $subject, $message, $headers)) {
    echo "Email sent successfully.";
} else {
    echo "Failed to send email.";
}
?>