Perplexing PHP mail from address not getting through if major domain like yahoo

fukufuji

New Member
Messages
8
Reaction score
0
Points
0
Hi I have a PHP form that I debugged and is working now but I still don't understand the root cause. I build the email msg header to include a "From e-mail address". This string comes in by user input in the Email field on the HTML form.

$headers = 'From: '.$email_from."\r\n"

If the e-mail address happens to be from a major mail domain like yahoo or hotmail I will not receive the e-mail in my Gmail account (the PHP mail msg send destination). So for example if a person types in the from email address tito897@yahoo.com and submits the form the mesage will never arrive, The same goes for Hotmail, Gmail, etc... However if it were tito987@ahoo.com or tito@fakedomain.com it gets to my Gmail.

I worked around it by hard coding the from address to a non-major mail carrier domain and I know get all mail it just comes under this address below.

$headers = "From: A-PERSON@website.com\n";

Is GMAIL not accepting the messages becasue it can tell they are not really coming from Yahoo or Hotmail etc... The PHP code would actually fire off the mail from x10hosting servers and I am wondering if when Gmail gets it, the Gmail servers are looking for some kiond of predefinde yahoo handshake and when its not there its denying the mail msg. This was the only guess I could come up with.:dunno:
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Just tested sending (via PHP script on my x10 site) to my gmail account using my hotmail account address in the "From" field, and it went through.

But people have reported that they could send emails with 3rd party "From" addresses for awhile, then they stopped. Staff hasn't said as much, but I think the system might be set up to stop such emails to prevent spamming and phishing or other abuse.

Just set the "From" field to an address attached to your domain (and put your visitor's email address in the body of the message). That usually fixes the problem.
 
Last edited:

freecrm

New Member
Messages
629
Reaction score
0
Points
0
gmail is pretty good at receiving mail, but yahoo and others are more sensitive and check if the source is the same as the "from"

I also tried X-sender, but this doesn't work all the time either.

There are also a number of mail servers that have blacklisted mail coming from x10 servers. I have a CRM system with mailshot function and some of my users complain about this. I also have the same problem with registration validation mails.
 

fukufuji

New Member
Messages
8
Reaction score
0
Points
0
Thanks for the feedback guys for a while I thought I was going bonkers. Glad I posted.

I am certainly going to implement this fix, I don't need to reply to the email I receive just want to keep it on file and have it seperate in its own gmail thread and this will work great.

Just set the "From" field to an address attached to your domain (and put your visitor's email address in the body of the message). That usually fixes the problem.
 
Top