1

I am trying to send an email from GoDaddy email in nodemailer but it is not sending.

exports.transporter = nodemailer.createTransport({
         host: "smtpout.secureserver.net",  
         secureConnection: true,
         port: 587,
         auth: {
             user: 'my@domain',
             pass: '*********'
         }
  })

this is my error

 Error: Invalid login: 535 Authentication Failed for my@domain
at SMTPConnection._formatError 

code: 'EAUTH', response: '535 Authentication Failed for my@domain', responseCode: 535, command: 'AUTH PLAIN' }

  • 1
    Does this answer your question? [nodemailer Invalid login: 535 Authentication Failed](https://stackoverflow.com/questions/65983495/nodemailer-invalid-login-535-authentication-failed) – Nicolae Maties Oct 13 '21 at 08:17

1 Answers1

1

TLS (Transport Layer Security) need to be enabled and secureConnection: false, Try This configuration, it's should works! ;-)

const mailTransport = nodemailer.createTransport({    
    host: "smtpout.secureserver.net",  
    secure: true,
    secureConnection: false,
    tls: {
        ciphers:'SSLv3'
    },
    requireTLS:true,
    port: 465,
    debug: true,
    auth: {
        user: "my@domain",
        pass: "**********" 
    }
});
MarioG8
  • 5,122
  • 4
  • 13
  • 29
  • Thanks you but Still it is not working and showing the same error – Prithiraj Goswami Oct 13 '21 at 09:34
  • @Prithiraj Goswami Hmmm. If the console shows the same error again ... then check your Login and password again. Are you sure they are correct? You can also try changing the SSL Port: 465 to 587 – MarioG8 Oct 13 '21 at 09:46
  • Yes I logged in with the same email password it logged in successfully – Prithiraj Goswami Oct 13 '21 at 09:55
  • With port 587 this error is coming. [Error: 139698950920064:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332: ] { library: 'SSL routines', function: 'ssl3_get_record', reason: 'wrong version number', code: 'ESOCKET', command: 'CONN' } – Prithiraj Goswami Oct 13 '21 at 09:56
  • I have one more idea. Remember that in the options for sending the message, FROM must be the same as USER in auth!!!!. And if that doesn't help, check out this link. Good luck and Don't give up easily ;-) Best regards https://github.com/nodemailer/nodemailer/issues/920 – MarioG8 Oct 13 '21 at 10:05
  • Yes, I have the same user in FROM. Thanks – Prithiraj Goswami Oct 13 '21 at 10:12
  • You're Welcome! If I were you, I would be looking for GoDaddy in the settings panel right now, that seems to be the best clue. – MarioG8 Oct 13 '21 at 10:20
  • The solution is working for me !! – Janen R Aug 19 '23 at 21:12