I am trying to send mail by using nodemailer's mail api from express js server on microsoft azure. It's getting success in local machine but not on azure server(remote). Any idea?

 var mail = require("nodemailer").mail;
 mail({from: "from@gmail.com", // sender address
       to: "to@gmail.com", // list of receivers
       subject: "subject", // Subject line
       text: "text", // plaintext body
       html: "<b>helloworld</b>" // html body
      });

thanks, av

有帮助吗?

解决方案

Just in case someone else meet the same problem.

I had the same problem about running Nodemailer in Azure Website. Finally I found the problem was that I forgot put Nodemailer as a dependency in package.json. Then azure did not know it had to install Nodemailer for the hosted server.

Add "nodemailer" : "*" at the end of dependency list in package.json. Don't forget to add a "," after the last line before you add "nodemailer".

Hope it helps.

其他提示

Please do changes in iisnode.yml file to call newer nodejs version as follows- nodeProcessCommandLine: "D:\Program Files (x86)\nodejs\8.5.0\node.exe"

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top