Nodemailer send email without smtp transport

前端 未结 7 1401
孤街浪徒
孤街浪徒 2021-02-01 19:47

I am trying to send emails via nodemailer without SMTP transport. So i\'ve done that:

var mail = require(\"nodemailer\").mail;

mail({
    from: \"Fred Foo ✔ <         


        
7条回答
  •  情话喂你
    2021-02-01 20:08

    probably it is windows firewall or antivirus preventing outgoing access. try to enable nodemailer debug messages.

    Enabling debug

    var nodemailer = require("nodemailer"),
      transport = nodemailer.createTransport('direct', {
        debug: true, //this!!!
      });
    
    transport.sendMail({
        from: "Fred Foo ✔ ", // sender address
        to: "******@gmail.com", // list of receivers
        subject: "Hello ✔", // Subject line
        text: "Hello world ✔", // plaintext body
        html: "Hello world ✔" // html body
    }, console.error);
    

提交回复
热议问题