Skip to content

extending e-mail node's usage of nodemailer createTransport #123

@cowchimp

Description

@cowchimp

Hi.

The outgoing email node uses nodemailer to send email.
AFAIK, node-red doesn't let you change the options passed to nodemailer's createTransport method, which is crucial for use with some SMTP providers.

Some of the most well-known email providers require configuring the transport with more options other than just server and port, so it needs to be extendable in some way.

Would be more than happy to send a PR with a fix and tests, but wanted to ask about how you want to approach this.

Here's 2 cents:
Adding extra transport fields via the UI is probably not a good idea because it's too much of an edge-case, but maybe this is the sort of thing that should be extendable by passing in a msg with an extra property which contains an object that should be merged with the default configuration object.

It's not just a matter of enabling adding properties though, because right now the transport object is configured with secure: true by default, and this causes errors in some mail providers.
Removing this now would break existing flows, so if avoiding a breaking change is a priority, we could either
(a) Expose this as a checkbox in the UI which defaults to checked.
(b) Allow to override the default true by passing secure: false in the aforementioned new msg configuration property.

WDYT?

For reference:

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions