// Create the mail function with SMTP settings
function smtp_mail($to, $subject, $message, $headers) {
// Set up the SMTP connection
$smtp = new SmtpClient();
$smtp-connect($smtp_server, $smtp_port);
$smtp-auth($smtp_username, $smtp_password);
// Send the email
$smtp-send($to, $subject, $message, $headers);
}
// Call the smtp_mail function
smtp_mail($to, $subject, $message, $headers);
?