hansmiddelhoek
Verified User
Hello,
I wrote a mail script, but when I use de additional section of the php mail() function for the from address, the e-mail can't be sent.
What's happening:
The httpd.conf for all domains get an:
The -f [email protected] takes care of the return path address in e-mails sent with php.
What I want is a different return path/from address, but when I specify the -f parameter in the mail() function an error occurs. The value of sendmail_path can't be overridden. I also tried .htaccess, but I couldn't get it to work either.
Does anybody know how I could workaround this problem, or just a simple solution?
Thanks in advance.
Kind regards,
Hans Middelhoek
I wrote a mail script, but when I use de additional section of the php mail() function for the from address, the e-mail can't be sent.
What's happening:
The httpd.conf for all domains get an:
Code:
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'
What I want is a different return path/from address, but when I specify the -f parameter in the mail() function an error occurs. The value of sendmail_path can't be overridden. I also tried .htaccess, but I couldn't get it to work either.
Does anybody know how I could workaround this problem, or just a simple solution?
Code:
bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] )
additional_parameters (optional)
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.
mail('[email protected]', 'the subject', 'the message', null,
'[email protected]');
Thanks in advance.
Kind regards,
Hans Middelhoek
Last edited: