0

I'm trying to send mail with nodemailer from my page .

I'm using React js for the frond end .

When I'm trying to run the server with npm run dev I got this message

npm run server

npm run client exited with code -4058

I can't understand the code -4058 what does it mean .

Caroline
  • 135
  • 1
  • 11
  • nodemailer is a nodejs module. Not sure if it runs on the browser. It might make use of a Nodejs dependency not supported on the browser. – vijayst Jun 22 '18 at 09:10
  • 1
    Possible duplicate of [Can I use nodemailer in browser?](https://stackoverflow.com/questions/37630543/can-i-use-nodemailer-in-browser) – vijayst Jun 22 '18 at 09:11
  • no I already have the server side and I used express – Caroline Jun 22 '18 at 09:17

1 Answers1

0

NO. You cant send mail using nodemailer via react first it is nodejs module work at server side not on the browser.

You can either mailto email-link

<a href="mailto:nowhere@mozilla.org">Send email to nowhere</a>

Or as you mentioned make REST API call to your express using data to send email and send email from there.

Revansiddh
  • 2,932
  • 3
  • 19
  • 33