I've been chasing this for a few days and really need some kind soul to help me out.
In a "Contact Form" I'm trying to allow the user to email the system admin.
Both the SentBy email and SentTo email addresses are actually gmail addresses...
but shown as gmailX in the example below.
I've Googled and read many threads but I guess I haven't stumbled on the right one so any help would be greatly appreciated.
Why doesn't the code below work?
It seems to run on the GoDaddy Linux Server but the email never arrives at the SentTo address.
Thanks for any help!!!
In a "Contact Form" I'm trying to allow the user to email the system admin.
Both the SentBy email and SentTo email addresses are actually gmail addresses...
but shown as gmailX in the example below.
I've Googled and read many threads but I guess I haven't stumbled on the right one so any help would be greatly appreciated.
Why doesn't the code below work?
It seems to run on the GoDaddy Linux Server but the email never arrives at the SentTo address.
Thanks for any help!!!
PHP:
<?php
$msg = "First line of text\nSecond line of text";
$SentBy = "abc@gmailX.com";
$SentTo = "xyz@gmailX.com";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <'.$SentBy.'>' . "\r\n";
// send email
mail($SentTo,"My subject",$msg,$headers);
?>