I am facing problem in receiving mail to my Gmail from a contact form on my website. Contact form is connected to a small PHP script. My website is uploaded on aws instance server and DNS on route 53.
Everything is updated in DNS (route 53) like MX records, SPF, DKIM, DMARC and everyday I got DMARC report but not receiving any mails for the contact form.
Below are the details
PHP script
<?php
$to = "info@mydomain";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: sender@example.com";
mail($to,$subject,$txt,$headers);
?>
MX records
1 ASPMX.L.GOOGLE.COM
5 ALT1.ASPMX.L.GOOGLE.COM
5 ALT2.ASPMX.L.GOOGLE.COM
10 ALT3.ASPMX.L.GOOGLE.COM
10 ALT4.ASPMX.L.GOOGLE.COM
SPF
"v=spf1 include:_spf.google.com ~all"
DKIM
The key which is provided by google
DMARC
"v=DMARC1; p=none; rua=mailto:info@mydomain"
These are the details updated on amazon DNS route 53 and still, I am not getting any mail.
Please anybody can help me with this.