Skip to content

Add support for additional parameters in native mailer #470

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nkl-kst
Copy link
Contributor

@nkl-kst nkl-kst commented Oct 31, 2023

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 -ftest@example.com 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: 'from@example.com'
    to_email: 'to@example.com'
    subject: 'Example subject'
    parameters:
        - '-ftest@example.com'

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant