PHP sends mail from 'nobody', how can I change it? Print

  • 26

Setting a proper 'From' address is important so that replies, bounces, etc go back to an appropriate address rather than the 'nobody' account on our web servers.

The PHP mail() function can be referenced here:

The last two parameters to mail(), which are optional, are "additional_headers" and "additional_parameters". They can both be used to ensure a properly set 'From' address.


Replace "" with something appropriate, but ensure that the "-f" is maintained.

There is also a handy PEAR package to facilitate mail operations in PHP. Check this page:

Was this answer helpful?

« Back