使用带有量角器的nod​​emailer时,发送电子邮件不会发送电子邮件

时间:2015-10-08 11:32:54

标签: javascript angularjs smtp protractor nodemailer

不会显示错误消息,也不会显示成功消息。此外,没有收到任何电子邮件。

这是我在量角器配置文件中的代码。这里没有电子邮件的错误响应,但也没有成功的消息,也没有收到电子邮件。

这是在配置文件

    onComplete: function () {

     creating reusable transport method (opens pool of SMTP connections)
            var smtpTransport = nodemailer.createTransport("SMTP", {
                host: "smtp.company.com",
                port: "110",
                auth: {
                    user: "anuvrat.singh@companyemail.com",
                    pass: "XXXX@2015"
                }

            });

      setup the email data
            var mailOptions = {
                from: "anuvrat.singh@Company.com", // sender address
                to: "anuvrat.singh@Company.com", 
                subject: "Hello ✔", // Subject line
                text: "Hello world ✔", // plaintext body
                html: "<b>Hello world ✔</b>" // html body
            }

   send mail with defined transport object
                smtpTransport.sendMail(mailOptions, function (error, response) {

if there is an error it will display other wise it will send the message
                if (error) {
                    console.log(error);
                } else {
                    console.log("Message sent: " + response.message);
                }
 shut down the connection pool, no more messages
                smtpTransport.close();

            });

    }

0 个答案:

没有答案