Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Documentation request: sending email from n8n

    N8N
    4
    6
    278
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jk last edited by jk

      Hello,

      Thank you for packaging n8n. I've been playing a bit with it and tried to send an email. I'd liked it to be able to send emails like any other application.

      This took a bit of fiddling, so I thought to write it up. Also, since it is not obvious how to do it, I would like this to be added to the n8n cloudron documentation so that the next user does not have to do the same research as I had to do.


      When setting up the email credentials, an expression is required for each of the fields:

      • User: {{$env["CLOUDRON_MAIL_SMTP_USERNAME"]}}
      • Password: {{$env["CLOUDRON_MAIL_SMTP_PASSWORD"]}}
      • Host: {{$env["CLOUDRON_MAIL_SMTP_SERVER"]}}
      • Port: {{$env["CLOUDRON_MAIL_SMTP_PORT"]}}
      • SSL/TLS: disabled

      To set an expression, click the gear icon next to the field, and click Add expression.

      cloudron_n8n_screenshot_1.png

      Then, in the expression field, paste the expression as listed before. The warning in red can be ignored, this will work fine when executing it.

      cloudron_n8n_screenshot_2.png

      Then, in a Send Email node, set the From Email field to the following expression: My App <{{$env["CLOUDRON_MAIL_FROM"]}}>.

      This will send an email with the name My App, and the address that is set in the cloudron settings.

      cloudron_n8n_screenshot_3.png

      Then, if you have set up the To and Subject, when you execute the node, you should get an email.

      cloudron_n8n_screenshot_4.png

      T BrutalBirdie 2 Replies Last reply Reply Quote 4
      • T
        thetomester13 App Dev @jk last edited by

        @jk this is great! I've had n8n configured to send emails, but I actually manually created a new user that has email access and put in the credentials myself. Very helpful!

        J 1 Reply Last reply Reply Quote 1
        • J
          jk @thetomester13 last edited by

          @thetomester13 Thanks 😄 I'm glad I've been of help!

          1 Reply Last reply Reply Quote 1
          • BrutalBirdie
            BrutalBirdie Staff @jk last edited by

            @jk maybe there is also a way to auto configure this, so no doc is needed.
            I will have a look at it tomorrow.

            Like my work? Consider donating a beer 🍻 Cheers!

            1 Reply Last reply Reply Quote 2
            • girish
              girish Staff last edited by girish

              Ah good docs. But I think the correct approach to this is to do what @thetomester13 suggested which is to create a mailbox and use those credentials. Ideally, generate "email" password credentials and put it into the app i.e via the Profile view in the App Password section. Generally, the "automated" email setup is really for apps to send notifications, password reset etc.

              In fact, I think it's a mistake to have sendmail addon in the app package. We should probably remove it. What do you guys think?

              1 Reply Last reply Reply Quote 2
              • girish
                girish Staff last edited by

                OK, just as a heads up, the next package will remove the sendmail addon to avoid this confusion. This for writing this post @jk ! I didn't know you can access things using {{$env[xx]}}

                1 Reply Last reply Reply Quote 2
                • First post
                  Last post
                Powered by NodeBB