I have created a mydomain@gmail.com account to use for outbound email on Moodle. This works on Moodle, I have ran the outbound mail test, and I have tested student self registration. I have done these tests multiple times, it always works.
But it does not work when using the contact form plugin. I have put echo statements in sendmail.php to make sure that sendmail.php is being called correctly, and that all the information is correct. But the message is never sent to the mydomain@gmail.com account.
$email=$_POST['email'];
echo "email $email";
$subject=$_POST['subject'];
echo "subject $subject";
$message=$_POST['message'];
echo "message $message";
mail("mydomain@gmail.com", $email ,$subject, $message);