Change From: address for mail from PHP

lbauer

Verified User
Joined
Dec 26, 2004
Messages
16
We have a customer that needs to set the email address that PHP sends mail as. They have tried setting it via their formmail script, with no sucess. If I look at the results of phpinfo() for their website it is showing sendmail_path as

/usr/sbin/sendmail -t -i -f [email protected]

Which I think is the source of the problem. Is there a way that I can set this manually for their domain?
 
Yep, we gave that a shot, but we can't over write the original return-path line, which is causing the problem with their mail firewall. So I am thinking we need to override that sendmail line.
 
You can change this in their httpd.conf file, but if they make any changes to the config it will get overwritten. This is hardcoded in the httpd.conf template.
 
Would it be possible to add it to the Custom HTTPD configurations? That would solve the problem of the change disappearing after an upgrade.
 
Just tried adding:

php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'

to the httpd customization section and it put it at the top of the virtual host section. It didn't work, so I wonder if it is being overridden by the default one further down.
 
Very likely. Apache will typically take the last directive it sees without any errors, warnings, etc.
 
Is there any way to make the custom settings show up at the bottom of the list?
 
Back
Top