Not able to connect to outlook.com SMTP using Nodemailer

前端 未结 3 1186
北恋
北恋 2021-02-04 03:58

I am creating the transport object like this.

var transport = nodemailer.createTransport(\"SMTP\", {
        host: \"smtp-mail.outlook.com\", // hostname
                


        
3条回答
  •  借酒劲吻你
    2021-02-04 04:41

    I was having the same issue until I stumbled upon https://github.com/andris9/Nodemailer/issues/165

    Try adding the tls cipher option to use SSLv3.

    var transport = nodemailer.createTransport("SMTP", {
        host: "smtp-mail.outlook.com", // hostname
        secureConnection: false, // TLS requires secureConnection to be false
        port: 587, // port for secure SMTP
        auth: {
            user: "user@outlook.com",
            pass: "password"
        },
        tls: {
            ciphers:'SSLv3'
        }
    });
    

    Alternatively, for hotmail/live/outlook you can simply use

    var transport = nodemailer.createTransport("SMTP", {
        service: "hotmail",
        auth: {
            user: "user@outlook.com",
            pass: "password"
        }
    });
    

提交回复
热议问题