I have a website with a number of forms for contacting club committee members (to avoid their email addresses appearing on the internet). I am finding that form submissions do not reach those who have Gmail addresses, not even into their junk/spam folders.
In PHP, after cleaning and some validation, I am constructing and sending the message as follows:
$emailContent = "From 'Contact Us' web page\n\n"
."Message:\n"
." {$Message}\n\n"
."Name:\n"
." {$Name}\n\n"
."Email:\n"
." {$Email}\n\n"
."Phone:\n"
." {$Phone}\n\n"
."";
$emailHead = "From:webmaster@xxxxxxxxx.co.uk\n"
."MIME-Version: 1.0\n"
."Content-type: text/plain; charset=utf-8\n"
."Content-transfer-encoding: 8bit\n";
mail("xxxxxxxxx@gmail.com","Website Form Submission",$emailContent,$emailHead);
Header("Location:contact-thanks.html");
This works fine for various email addresses that are not Gmail. However for a Hotmail address I receive a warning âWe canât verify that this email came from the sender so it might not be safe to respond to itâ, with a link to this Microsoft page:
https://support.microsoft.com/en-gb/office/phishing-and-suspicious-behavior-in-outlook-0d882ea5-eedc-4bed-aebc-079ffa1105a3
In the email head, messages are constructed to appear to be from the webmasterâs email address. I have read that this reduces the chance of messages being regarded as spam because itâs on the same domain as the website.
Is there something I can do so messages from website forms will be received by Gmail addresses?