phpsendmailssmtp

PHP mail() function and execute sendmail with different configuration


Is there any way to execute PHP mail() function with some arguments so sendmail will load different configuration? Something similar like Python can do with a code below

ssmtp = "/usr/sbin/ssmtp" args = [ssmtp, '-v', '-v', '-v', '-C', '/etc/ssmtp/ssmtp-locrelay.conf', to_address]


Solution

  • The binary can be changed with the sendmail_path directive and command-line arguments go as $additional_parameters:

    bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )