mail() hostname question

Jorge

Well-Known Member
Feb 19, 2003
49
1
158
There's any way to hide the hostname on email sent through php mail()?
I told to one of my customer to use a FROM header on the sending php script, however, still says [email protected] as the sender.

I'm not sure if this can be configured on the php mail() options or anywhere.
Is it possible?
 

webignition

Well-Known Member
Jan 22, 2005
1,876
2
166
The actual sender of the email will always, if you have phpsuexec enabled, be user@hostname because the actual sender is the user at the given host. Otherwise it will be nobody@hostname for the exact same reasons.

You can set the From: header, and this is the value most commonly displayed in email clients. This is specified in the fourth parameter of the PHP mail() function.