Does php mail call use php.ini sendmail.ini
When using the mail()
function in PHP, it uses the sendmail binary specified in the sendmail_path
directive in the php.ini
file. This is true even if you have a sendmail.ini
file.
Here's what happens:
- PHP looks for the
sendmail_path
directive in thephp.ini
file. - If
sendmail_path
is set, PHP uses the specified sendmail binary to send the email. - If
sendmail_path
is not set, PHP falls back to using the default sendmail binary, which is usually/usr/sbin/sendmail
on Unix-like systems.
The sendmail.ini
file is used by the sendmail
binary to configure its behavior. It's not directly related to the mail()
function in PHP.
However, if you're using the sendmail
binary as the sendmail_path in your php.ini
file, then the settings in sendmail.ini
will be used to configure the sendmail binary.
To summarize:
php.ini
controls the behavior of themail()
function in PHP.sendmail.ini
controls the behavior of thesendmail
binary.- If you're using the
sendmail
binary as the sendmail_path in yourphp.ini
file, then the settings insendmail.ini
will be used.
I hope that helps clarify things!