setMailer is not defined (using global Mailer)

Wappler Version : 3.5.5
Operating System : Mac
Server Model: NodeJS
Database Type: MySql8
Hosting Type: AWS, Docker.

Expected behavior

I should be able to use the global mailer setup, and simply add a sendmail step to a server action.

Actual behavior

What actually happens?

Two different types of errors. If I use only a ‘Send Mail’ step, using the global Mailer then I get a ‘setMailer is not defined’ error:

{"status":"500","message":"setMailer is not defined","stack":"ReferenceError: setMailer is not defined\n at App.getMailer (/opt/node_app/lib/core/app.js:124:13)\n at App.send (/opt/node_app/lib/modules/mail.js:47:26)\n at App._exec (/opt/node_app/lib/core/app.js:384:57)\n at App._exec (/opt/node_app/lib/core/app.js:355:28)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)\n at async App.exec (/opt/node_app/lib/core/app.js:324:9)\n at async App.define (/opt/node_app/lib/core/app.js:314:9)"}

If I add a Setup Mailer step before hand in the server connect I get the following error:

  1. code: “ESOCKET”
  2. message: "connect ECONNREFUSED 1xx.xxx.xxx.’

How to reproduce

Setup a SMTP Mailer Step, then add a send mail step to a server action. I’m retrieving $_POST values from the page, and sending to our generic email address.

Here an update, unzip in lib/core.

app.zip (3.4 KB)

Hey @patrick - I updated the app.js file from another, later post here.

But now I get this error:

{"status":"500","code":"EENVELOPE","message":"Mail command failed: 550 Unauthenticated senders not allowed","stack":"Error: Mail command failed: 550 Unauthenticated senders not allowed\n at SMTPConnection._formatError (/opt/node_app/node_modules/nodemailer/lib/smtp-connection/index.js:774:19)\n at SMTPConnection._actionMAIL (/opt/node_app/node_modules/nodemailer/lib/smtp-connection/index.js:1543:34)\n at SMTPConnection.<anonymous> (/opt/node_app/node_modules/nodemailer/lib/smtp-connection/index.js:1025:18)\n at SMTPConnection._processResponse (/opt/node_app/node_modules/nodemailer/lib/smtp-connection/index.js:932:20)\n at SMTPConnection._onData (/opt/node_app/node_modules/nodemailer/lib/smtp-connection/index.js:739:14)\n at TLSSocket.SMTPConnection._onSocketData (/opt/node_app/node_modules/nodemailer/lib/smtp-connection/index.js:189:44)\n at TLSSocket.emit (events.js:315:20)\n at addChunk (_stream_readable.js:295:12)\n at readableAddChunk (_stream_readable.js:271:9)\n at TLSSocket.Readable.push (_stream_readable.js:212:10)"}

See:

Thanks @George but, we have been sending from this email address for 2+ years, and still currently send via this email from our original platform.

In addition, we used this email address to send from Wappler before with no isssues, so that can’t really be the issue.

Not sure if this is related, but I’ll just throw out here that Sendgrid recently deprecated logging in via username and password – it now requires an apikey. You use “apikey” as the username and the apikey value in password.

1 Like

Thanks @mebeingken, that’s how we connect to Sendgrid :slight_smile:

I am moving to Postmark soon, so maybe I just need to do that faster to see if it resolves the above issue.

Yep, I just used Patrick’s update and now see the same error as @mgaussie

1 Like

Hey team, just bumping this as we do need to be able to send notifications our from our app.

I’ve posted this update in an other topic, unzip it in lib/core.

app.zip (3.7 KB)

1 Like

Thanks @patrick - didn’t see the other post. Will try this, thank you!

Sorry, unrelated, switched from SendGrid to Postmark - sooo much better. Deliverability rates increased nearly 20% and almost instant email to inbox time. Currently using an API step rather than the Send Mail component. No bugs. Also using Postmarks template feature so let them handle the HTML email side of things.

1 Like

Thanks @max_gb i’ve heard the same, and to be honest - SendGrid’s support has always been horrible. Looking forward to the switch, we’ll use the API too when we make it, but for now still using SMTP with sendgrid.

1 Like

This topic was automatically closed after 24 hours. New replies are no longer allowed.