Problem with NodeJS Email

Probably one of my senior moments, but this one has me beat.

The Mailer setup (don’t worry, this is a working fake account using Ethereal Email)

The error message is:

{“status”:“500”,“message”:“Cannot set property ‘mail’ of undefined”,“stack”:“TypeError: Cannot set property ‘mail’ of undefined\n at App.setMailer (/var/www/vhosts/fumantology.com/app/lib/core/app.js:78:32)\n at App.setup (/var/www/vhosts/fumantology.com/app/lib/modules/mail.js:12:14)\n at App._exec (/var/www/vhosts/fumantology.com/app/lib/core/app.js:224:57)\n at App._exec (/var/www/vhosts/fumantology.com/app/lib/core/app.js:206:28)\n at App.exec (/var/www/vhosts/fumantology.com/app/lib/core/app.js:177:20)\n at App.condition (/var/www/vhosts/fumantology.com/app/lib/modules/core.js:97:24)\n at App._exec (/var/www/vhosts/fumantology.com/app/lib/core/app.js:224:57)\n at App.exec (/var/www/vhosts/fumantology.com/app/lib/core/app.js:177:20)\n at App.define (/var/www/vhosts/fumantology.com/app/lib/core/app.js:160:20)\n at processTicksAndRejections (internal/process/task_queues.js:89:5)”}

Perhaps I should have posted this as a bug, but I prefer to see if anyone else has had this problem or is it just me :older_adult:.

Have you selected the mail step in the Send Mail step?

Thank you for your reply. I think the answer is yes.

What if you rename it to something like mail1 - and select it again?

The error message now contains mail1

{“status”:“500”,“message”:“Cannot set property ‘mail1’ of undefined”,“stack”:“TypeError: Cannot set property ‘mail1’ of undefined\n at App.setMailer (/var/www/vhosts/fumantology.com/app/lib/core/app.js:78:32)\n at App.setup (/var/www/vhosts/fumantology.com/app/lib/modules/mail.js:12:14)\n at App._exec (/var/www/vhosts/fumantology.com/app/lib/core/app.js:224:57)\n at App._exec (/var/www/vhosts/fumantology.com/app/lib/core/app.js:206:28)\n at App.exec (/var/www/vhosts/fumantology.com/app/lib/core/app.js:177:20)\n at App.condition (/var/www/vhosts/fumantology.com/app/lib/modules/core.js:97:24)\n at App._exec (/var/www/vhosts/fumantology.com/app/lib/core/app.js:224:57)\n at App.exec (/var/www/vhosts/fumantology.com/app/lib/core/app.js:177:20)\n at App.define (/var/www/vhosts/fumantology.com/app/lib/core/app.js:160:20)\n at processTicksAndRejections (internal/process/task_queues.js:89:5)”}

1 Like

I was able to recreate it.

@patrick will check the issue and it will be fixed in the next update.

2 Likes

I am glad that it was not this old codger once again :laughing:

4 Likes

+1 for me on this issue. Glad I found this post, I’ll stop trying to figure out what I’m doing wrong!

Since it will take a while for the update to appear. Here the updated file that is needed to fix this problem. Place it in lib/core.

app.zip (2.4 KB)

Let me know here if there are still some issues.

Hi @patrick,

Still having a problem, not sure if it is me.

{“status”:“500”,“message”:“mail.send: fromEmail is required.”,“stack”:“Error: mail.send: fromEmail is required.\n at App.parseRequired (/var/www/vhosts/pleysier.com.au/app/lib/core/app.js:289:19)\n at App.send (/var/www/vhosts/pleysier.com.au/app/lib/modules/mail.js:18:30)\n at App._exec (/var/www/vhosts/pleysier.com.au/app/lib/core/app.js:251:57)\n at App._exec (/var/www/vhosts/pleysier.com.au/app/lib/core/app.js:233:28)\n at processTicksAndRejections (internal/process/task_queues.js:89:5)\n at async App.exec (/var/www/vhosts/pleysier.com.au/app/lib/core/app.js:204:9)\n at async App.condition (/var/www/vhosts/pleysier.com.au/app/lib/modules/core.js:97:13)\n at async App._exec (/var/www/vhosts/pleysier.com.au/app/lib/core/app.js:251:30)\n at async App.exec (/var/www/vhosts/pleysier.com.au/app/lib/core/app.js:204:9)\n at async App.define (/var/www/vhosts/pleysier.com.au/app/lib/core/app.js:187:9)”}

Test page:
https://pleysier.com.au/contact-us

IMPORTANT EDIT:
The proposed app.js causes problems when user tries to log out.

Hello Ben,

The error you have is when no email was supplied. I tested your page and got an other error: Hostname/IP does not match certificate's altnames: IP: 119.224.146.130 is not in the cert's list: , something with not being able to validate the certificate.

What kind of problems causes it? Do the problems go away when restoring the old app.js again?

Thanks Patrick, will check the certificate.

The log out problem goes away when the original JS is restored.

I could perhaps add an option to ignore the certificate, a lot of mail servers don’t have the certificate setup correctly.

Will check the the logout problem in the meantime.

1 Like

I can’t find any changes in the app.js that could explain any problems with logout. What kind of problems do users have when trying to logout?

Apologies for the late reply. This is the error message when logging out:

{“status”:“500”,“message”:“Cannot read property ‘connection’ of undefined”,“stack”:“TypeError: Cannot read property ‘connection’ of undefined\n at App.setDbConnection (C:\Users\BenP\www\kidsjs\lib\core\app.js:146:21)\n at App.getDbConnection (C:\Users\BenP\www\kidsjs\lib\core\app.js:167:25)\n at new DatabaseProvider (C:\Users\BenP\www\kidsjs\lib\auth\database.js:9:23)\n at App.setAuthProvider (C:\Users\BenP\www\kidsjs\lib\core\app.js:125:34)\n at App.provider (C:\Users\BenP\www\kidsjs\lib\modules\auth.js:5:31)\n at App._exec (C:\Users\BenP\www\kidsjs\lib\core\app.js:251:57)\n at App.exec (C:\Users\BenP\www\kidsjs\lib\core\app.js:204:20)\n at App._exec (C:\Users\BenP\www\kidsjs\lib\core\app.js:223:25)\n at async App._exec (C:\Users\BenP\www\kidsjs\lib\core\app.js:233:17)\n at async App.exec (C:\Users\BenP\www\kidsjs\lib\core\app.js:204:9)”}

Reverting to original, no problem.

I think that I found the problem, here an update.

app.zip (2.4 KB)

This is fixed in Wappler 3.0.2

1 Like