PHP mail
Tuesday 12/18/2007 – Category: Uncategorized
How to use the often overlooked fourth parameter while using mail function in php:
bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path configuration setting. For example, this can be used to set the envelope sender address when using sendmail with the -f sendmail option.
The user that the webserver runs as should be added as a trusted user to the sendmail configuration to prevent a ‘X-Warning’ header from being added to the message when the envelope sender (-f) is set using this method. For sendmail users, this file is /etc/mail/trusted-users.
Example usage:
mail($email, $subject, $body, $headers, ‘-fnoreply@mydomain.com’)
Leave a Reply
Recent Posts
- Marble Paint
(Friday 02/4/2011 – 1 Comment) - More Flickr Original Updates
(Sunday 01/23/2011 – 13 Comments) - Flickr Original updates
(Saturday 08/7/2010 – 19 Comments) - LED Light for iPhone 4
(Monday 06/28/2010 – 65 Comments)
