Nodemailer send email without smtp transport

前端 未结 7 1390
孤街浪徒
孤街浪徒 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:14

    use nodemailer 0.7.1.
    if you previously installed nodemailer then remove it by

    npm remove nodemailer
    

    now install it by

    npm install nodemailer@0.7.1
    

    the following code send mail without login, but it will work only in production environment, it won't work locally

    var mail = require("nodemailer").mail;
    
    mail({
        from: "Fred Foo ✔ ", // sender address
        to: "bar@blurdybloop.com, baz@blurdybloop.com", // list of receivers
        subject: "Hello ✔", // Subject line
        text: "Hello world ✔", // plaintext body
        html: "Hello world ✔" // html body
    });
    

提交回复
热议问题