Changing the default "From:" email address for emails sent via PHP on Linux
I’ve had to solve this problem a couple of times at least, and it’s quite a common task, so I thought I’d document it here. When you send emails to users of your site through using the PHP mail() function, they will sometimes turn up in the mailbox of customers of your site with the following from address: From: Root <root@apache.ecommercecompany.com> This makes absolutely no sense to your customers, and often they will think it is spam and delete it. Often, the decision will be made for them by their web mail host, such as hotmail.com or googlemail.com, and they will never even see the email. You don’t want this to happen. ...