monolog-bundle
monolog-bundle copied to clipboard
Add support for additional parameters in native mailer
This PR adds support for additional parameters to the native mailer, as describe in https://www.php.net/manual/en/function.mail.php
The additional_params parameter can be used to pass additional flags as command line options to the program configured to be used when sending mail, as defined by 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.
In a recent project we had the requirement to set the additional parameter [email protected] to be able to send emails through a relay server. Otherwise the mails were bounced.
The bundle currently allows to set these parameters only on existing logger instances. This PR allows to set them in the configuration file:
native_mailer:
type: native_mailer
from_email: '[email protected]'
to_email: '[email protected]'
subject: 'Example subject'
parameters:
- '[email protected]'