Php mail envelope header
From Webpipe Wiki
PHP's Default Configuration
PHP's default configuration sets the envelope header on outgoing messages to the user that the web server is running as. On most configurations, this would be something like "nobody@web9.webpipe.net" or "apache@web5.webpipe.net". Obviously, this isn't incredibly useful. The bounces would get sent back to that address, which would eventually end up in our system administrators inboxs'.
Webpipe's Configuration
PHP does provide a way to pass arguments directly to sendmail, and therefore modify the envelope "from" address, but most programs, and custom PHP scripts that people write never use it. So, at Webpipe, we have modified PHP's configuration to set the envelope from address to "your_username@web9.webpipe.net". Email delivered to that address is forwarded based on the ".forward" file in your home directory. When we set-up your account initially, the .forward file contains the email address that you specified during sign-up. You can modify the .forward file to forward to any email address that you would like.
Customizing the envelope header
If you have a need to modify the envelope from address on your site, we can disable setting this to "your_username@webx.webpipe.net". Just send us an e-mail to support@webpipe.net .
Please make sure that you set an appropriate envelope header each time that you call PHP's mail() function. This is done by using the optional 5th argument. The 5th argument is actually passed to the sendmail program when it is executed. Use sendmail's "-f" parameter to set the envelope header. All of our web servers are set up to allow the web server user to use the "-f" parameter without generating the "X-Authentication-Warning" header.
Function Definition for mail() from php.net
bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] )
Example Code:
$to_address = "somebody@somewhere.com"; $email_subject = "Subject of your message"; $email_body = "This is the body of the email message!"; $email_header = "From: Website Name <from_address@your_domain.com>\r\n"; $sendmail_args = "-fbounce_address@your_domain.com"; mail($to_address, $email_subject, $email_body, $email_header, $sendmail_args);
As always, please let us know if you need any assistance making these changes



