New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support headers for native_mailer #272
Comments
Hello @anthonybocci Would you mind to submit a PR? Thanks |
The native mailer is able to have additional headers, but it wasn't possible to give it any headers in the configuration. Swift mailer may have a content_type key but not native mailer. A new "headers" key is now allowed in the handler configuration, so a list of headers may be given to the handler. Only native mailer supports it. Related to symfony#272
Hi @lyrixx, I just submitted a PR. |
The native mailer is able to have additional headers, but it wasn't possible to give it any headers in the configuration. Swift mailer may have a content_type key but not native mailer. A new "headers" key is now allowed in the handler configuration, so a list of headers may be given to the handler. Only native mailer supports it. Related to symfony#272
The headers type was defined as a choice, but it's not. It's a sequence of strings. See: symfony#272
The field "headers" was defined as an attribute but it's a complex type so it's an element instead. See: symfony#272
…lyrixx) This PR was merged into the 3.x-dev branch. Discussion ---------- Add support for headers in native mailer The native mailer is able to have additional headers, but it wasn't possible to give it any headers in the configuration. Swift mailer may have a content_type key but not native mailer. A new "headers" key is now allowed in the handler configuration, so a list of headers may be given to the handler. Only native mailer supports it. Related to #272 Commits ------- 19eaa0f Fix 'Add support for headers in native mailer' 7ecbc9e Add support for headers in native mailer
@nalysius sorry for necro-posting, but were you able to override the
I think the possible solution is to add @lyrixx can you also look at it, please? |
@ilya-realforce I am currently using the Monolog handles the content-type in a special field, so even if we give it a header it will then use the content type and add it as a header. I guess it would be better in |
I am currently using Monolog to receive mails when I log errors. With the
swift_mailer
handler I don't receive any mails usingsendmail
transport. I am used to useNativeMailerHandler
with Monolog so I would like to use it as handler. Withnative_handler
I receive emails, but they are always in plain text.The
swift_mailer
handler does support acontent_type
key that allows to get the mail as text/html.The NativeMailerHandler class has a
headers
attribute that could contains acontent-type
. For now onlyswift_mailer
is able to send email as html, native_mailer doesn't use any 'headers' or 'content_type' keys.The following example would be fully compatible with
swift_mailer
.But this one would be more flexible with the usage of headers.
The text was updated successfully, but these errors were encountered: