I'm trying to get php mail() working with gmail. It sends the message to my domain fine however it isn't received if I change it to my gmail address. I did try PHPMail but read here that uses mail(), so that didn't work either. Does anyone know a way around it? Thanks
<?php
echo "About to send test email...<br />";
$to = "XXXXXX@gmail.com";
$subject = "Test Mail";
$message = "Hello world!";
$headers = "From: YYYYYYY.helioho.st";
$success = mail($to, $subject, $message, $headers);
if ($success) {
echo "Mail sent successfully...<br />";
} else {
echo "*** Mail could not be sent...<br />";
}
?>