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

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:
http://www.php.net/manual/en/function.mail.php

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.

Example:
mail("target@address.com",
"subject",
"message",
"From: your@address.com",
"-fyour@address.com"
);

Replace "your@address.com" 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: http://pear.php.net/package/Mail

  • 25 Users Found This Useful
Was this answer helpful?

Related Articles

Configuring Microsoft Outlook Express

To setup your new email account in Outlook Express:   We have used yourdomain.com in this...

I cannot send email.

This could be the result of several factors, please go through the list below and eliminate each...

Can't send email? Is your port 25 blocked?

Can't send email? It's possible that your ISP or computer configuration is blocking the port 25...

I check my email every day, but it's full, why?

If you don't delete your emails from the mailbox on the server then they will remain in your web...

How do I filter email marekd by Spam Assassin?

Follow the steps below to set up a filter in Microsft Outlook to capture mail flagged as spam by...