Im sure we're all familiar with this. When sending an email from php to gmail, it will append "via hosted35.nfoservers.com" as an anti-spoofing measure.
I have done some searching on gmail/google's own information and the forums here. I found this post about adding an SPF record. I did this.
Sending e-mails still shows the "via ..." text. Are there any other steps that can be taken to "prove" these emails sent by my script are legitimate? Is there a way to login to my actual email account via script and send that way (if such a thing would even work)?
Thanks
Email showing "via hosted35.nfoservers.com"
-
- New to forums
- Posts: 3
- https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
- Joined: Mon Jun 22, 2020 2:30 am
Re: Email showing "via hosted35.nfoservers.com"
As long as you have an SPF record setup correctly, you should just need to set the correct headers for the PHP mail function, which will have Gmail strip off the "via" tag. Most importantly, you'll want to ensure your From and Return Path headers are set.
Try the following setup for your mail function:
Try the following setup for your mail function:
Code: Select all
$headers = "From: email@domain.com";
$headers .= "\r\nReply-To: email@domain.com";
mail('email@gmail.com', 'Test message subject', 'Test message', $headers,'-freturn@domain.com');