mardi 4 août 2015

Why nodemailer doesn't work on AWS Server -NodeJS

I am using nodemailer 0.7.1 and I can sent emails on my localhost. But when I use it with AWS Server, didn't get any such mail. Please help me.

  var smtpTransport = mailer.createTransport("SMTP",{
     service: "Gmail",
     auth: {
         user: "from@gmail.com",
         pass: "********"
     }
   });
  var mail = {
         from   : "from@gmail.com",
         to     : "to@gmail.com",
         subject    : "dummy subject",
         html   : "dummy message"
     }

  smtpTransport.sendMail(mail, function(error, response){
     if(error){
         console.log(error+"console error");
         smtpTransport.close();
     } else{
         logger.info("Mail sent: " + response.message);
         smtpTransport.close();

    }




1 commentaire: