1

I bought a domain and an email adrees with GoDaddy with Office 365 Basic bundled with it.

I'm trying from a few days to send just an email with nodemailer from my node app without ever succeding because I always get a 535 Authentication Failed from user@domain.com.

I've scanned StackOverflow for days trying every solution, this is every setting I've tried to pass to nodemailer.createTransport:

const mailerConfig = 
{
    //First set of parameters tried
    service: 'Godaddy',
    host: "smtp.office365.com",  
    secureConnection: true,
    port: 587,

    auth: 
    {
        user: "user@domain.com",
        pass: "password" 
    }


    //Second set of parameters tried
    host: "smtp.office365.com",
    secureConnection: false,
    port: "587",
    auth:
    {
        user : "user@domain.com",
        pass : "password"
    },
    tls:
    {
        ciphers:'SSLv3'
    }


    //Third set of parameters tried
    service: "outlook",
    auth: 
    {
        user: 'user@domain.com',
        pass: 'password'
    }
}

None of these three settings worked, someone has any idea? Thanks.

grizzo
  • 141
  • 1
  • 3
  • 10

4 Answers4

2

There is a godaddy FAQ entry called "Manually configure email set up on Thunderbird" (which seems to be only accessible via WaybackMachine).

It mentions the following configuration:

Incoming (IMAP): imap.secureserver.net    993     SSL  Normal password
Outgoing (SMTP): smtpout.secureserver.net 465,587 SSL  Normal password

and

Username: Workspace Email address

Using the above, especially smtpout.secureserver.net as SMTP Host works for me – tested with godaddy email in 2021.

Felix K.
  • 14,171
  • 9
  • 58
  • 72
1

If anyone is still having issues, this config is working for me actually in Sept 2021:

  var transporter = nodemailer.createTransport({
    host: "smtpout.secureserver.net",
    port: 587, // port for secure SMTP
    auth: {
      user: "youremailaddress",
      pass: "yourpassword",
    },
  });
0
  1. You must enable SMTP login for the O365 mailbox or user in the admin settings

enter image description here

enter image description here

  1. If the user has multifactor turned on, then you need to use "app password", normal password won't work if MFA is enabled.

https://learn.microsoft.com/en-us/azure/active-directory/user-help/multi-factor-authentication-end-user-app-passwords

  1. You need to disable security defaults or adjust Conditional Access policies.

https://learn.microsoft.com/en-us/azure/active-directory/fundamentals/concept-fundamentals-security-defaults

  1. Also, you can debug issue using sign-in logs in azure user account.

enter image description here

Shivaji Varma
  • 690
  • 13
  • 24
0

You need to enable all access enter image description here

and don't forget to disable the sms/call confirmation for the login

by the way this code i used on firebase cloud function/nodemailer

  cors(req, res, async () => {
    var transporter = nodemailer.createTransport({
      host: "smtp.office365.com",
      port: 587, // port for secure SMTP
      auth: {
        user: "user@domain.com",
        pass: "password",
      },
      tls: {
        ciphers: 'SSLv3'
      }

    });

    if (req.method === 'POST') {
      var mailOptions = {
        from:req.body.from,
        to: req.body.email, // list of receivers
        subject: req.body.subject, // Subject line
        text: req.body.text,
      };
      return transporter.sendMail(mailOptions).then(() => {
        res.status(200).send('Email has been sent to mr/ms : ' + req.body.email); return ("mail sent")
      });
    }
  })
asli
  • 433
  • 1
  • 5
  • 10