How can I use node-sendmail to send emails? This package crashed the server


I’m using the node-Sendmail npm package in my express JS app, which is like the MVC structure. I have some weird errors, like

    if ( {
TypeError: Cannot read properties of undefined (reading 'to')

enter image description here

Please see the image above. I tried to send the email when the login route was requested, but it sent the email after the server crashed, and this error showed. I checked their official GitHub and asked a question, but no one replied. Have you ever used a node-Sendmail package?

I checked to see if there were any errors in the node module package and code, and here is a screenshot.

enter image description here

I called the Sendmail with import module :

enter image description here


You’re calling sendmail with no configuration on line 47, that is throwing your error

Answered By – Falklian

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published