Hello I'm having a problem trying to send email to email addresses other then addresses on the server Im on via a php script. Basicly what Im trying to do is make a simple script that sends an email to my gmail account when its run.
here it is below email addresses edited for security of course.
<?
// mail acount settings
$server="{localhost/imap}";
$email = "fromaccnt@domain.com";
$password = "*****";
$link=imap_open($server,$email,$password);
$headers=imap_headers($link);
$to = "recieveaccnt@gmail.com";
$hders = "From: $email";
$subject = "dude this is cool";
$msg = " this is a test of our email system";
imap_mail($to, $subject, $msg, $hders);
imap_close($link);
echo 'mail has been sent to ' . $to . '';
?>
If I run the script and I never get anything showing up at gmail. but if I change the recieving address to an email account on the server i run the script on I will get an email it its account so I know the script does send something. Ive tried using hotmail. yahoo, comcast, even accounts on other servers to no avail non ever get an email(even in spam folders). Any ideas what I am doing wrong?