By default, PHP will send e-mail from the account you are running the script from. Usually this is in the format of:
To ensure the From: address displays correctly to your users, please ensure you are sending the return-path, reply-to and from headers with the mail() function. More information can be found from the PHP website. The following code has been tested to work successfully on our shared servers. Please be advised we do NOT support this code, and we will not help you with development of your mail scripts. The code shown is merely an illustration of correct header configuration:
$to = "email@example.com";
$subject = "Testing From Address";
$message = "This is a test, please disregard.";
$headers .= 'Return-Path: firstname.lastname@example.org' ."\r\n";
$headers .= 'From: Sender <email@example.com>' . "\r\n";
mail($to, $subject, $message, $headers);
In addition to the above, to "fix" the return-path header you will also need to invoke the mail() function with an extra "-f" parameter as such:
mail($to, $subject, $message, $headers, "-firstname.lastname@example.org");
Please note that if using Microsoft Outlook, or Hotmail (Live), you will see something similar to:
"From email@example.com on behalf of firstname.lastname@example.org"
This is normal behaviour, and unavoidable due to the way our servers add the Sender header to all e-mails for abuse tracking purposes. Other clients and companies (such as Google Apps) utilise the From header for sender sourcing, so do not exhibit this behaviour.