I am using the following code to send email from my website:
<?php
$to = "mygmail@gmail.com;
$subject = "My Site - NoReply";
$headers = "From: do not reply @ My Site" . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = "You have received a message from the My site: <br /><br />";
$message .= "Greetings <strong>My Name</strong>, <br /><br />";
$message .= "You have been granted access to the My site.<br /><br />";
mail($to, $subject, $message, $headers);
?>
My site is being hosted by Hostgator. They have advised me that I should use port 465 for SMTP.
I just finished chatting with them. Everything is set on their end, and there is nothing additional that they can do.
With that said, why am I unable to send the email using the above?
I've used this same code on my job, which uses an Apache server, and I have no problems sending any email from a website.
What am I missing to make this work?