I am trying to send an email from my live server (Godaddy hosting) using the PHP mail function I have written the script but when I am trying to open the mail.php file on my browser it isn't opening and throws an error This page isn’t working prac.shayankanwal.com is currently unable to handle this request. HTTP ERROR 500
(I am not using any forms just directly opening that file)
also, it is not Sending the email
I have been trying to figure this out for the last 6 hours reading about that issue on StackOverflow but nothing seems to work
also, another thing Does this mail function works without an SSL certificate or not?
here is the link to live server and below is the script I have written which is also on the live server
<?php
$to = "shayankanwal667@gmail.com";
$subject = "Test mail";
$message = "Hi This is a test email you received from server";
$from = "clientsupport@shayankanwal.com";
$headers = "From: $form";
if(mail($to,$subject,$message,$headers)){
echo "Email sent";
}else{
echo "Email NOT sent"
}
?>