Vincenzo Pepe
Vincenzo Pepe

Reputation: 11

I can't send emails from an aol address using nodemailer

I have a nodejs + express backend and I need to send an email to new subscribers containing a link to check if they actually own the address they submitted. At first I tried using sendmail because I didn't want to create a new email address and authenticate each time, but my emails kept getting rejected. Then I tried using nodemailer with a gmail account, but it looks like gmail doesn't like people authenticating from third party apps. Then I tried creating a zoho account (I read here on stackoverflow that it works fine and it would have been cool to have a personalized domain) but it required me to add a dns txt record to prove I "own" the domain (I'm hosting the website on render and I can't add dns records). Now I'm trying to use an aol address (it's one of the well known providers for nodemailer) but it won't let me authenticate, I tried authenticating both using the default port (587 in nodemailer) and the 465 port (got it from aol docs) but I got the same result. Here's the code I'm using:

const transporter = nodemailer.createTransport({
                            service: 'AOL', 
                            auth: {
                                user: process.env.MAIL_ADDR, 
                                pass: process.env.MAIL_PASS, 
                            },
                            port: 465
                        });

                        const mailOptions = {
                            from: process.env.MAIL_ADDR,
                            to: email,
                            subject: 'Codice di verifica dazeku',
                            text: "Verifica la tua email al link "+process.env.API_HOST+"/checkEmail?mctoken="+token
                        };

                        transporter.sendMail(mailOptions, (error, info) => {
                            if (error) {
                                console.log('Errore durante l\'invio dell\'email:', error);
                            } else {
                                console.log('Email inviata:', info.response);
                            }
                        });

And here's the error I'm getting:

Aug 15 09:45:35 PM  Error: Invalid login: 535 5.7.0 (#AUTH005) Too many bad auth attempts.
Aug 15 09:45:35 PM      at SMTPConnection._formatError (/opt/render/project/src/dazeku_wapp/node_modules/nodemailer/lib/smtp-connection/index.js:790:19)
Aug 15 09:45:35 PM      at SMTPConnection._actionAUTHComplete (/opt/render/project/src/dazeku_wapp/node_modules/nodemailer/lib/smtp-connection/index.js:1564:34)
Aug 15 09:45:35 PM      at SMTPConnection.<anonymous> (/opt/render/project/src/dazeku_wapp/node_modules/nodemailer/lib/smtp-connection/index.js:546:26)
Aug 15 09:45:35 PM      at SMTPConnection._processResponse (/opt/render/project/src/dazeku_wapp/node_modules/nodemailer/lib/smtp-connection/index.js:969:20)
Aug 15 09:45:35 PM      at SMTPConnection._onData (/opt/render/project/src/dazeku_wapp/node_modules/nodemailer/lib/smtp-connection/index.js:755:14)
Aug 15 09:45:35 PM      at SMTPConnection._onSocketData (/opt/render/project/src/dazeku_wapp/node_modules/nodemailer/lib/smtp-connection/index.js:193:44)
Aug 15 09:45:35 PM      at TLSSocket.emit (node:events:514:28)
Aug 15 09:45:35 PM      at addChunk (node:internal/streams/readable:324:12)
Aug 15 09:45:35 PM      at readableAddChunk (node:internal/streams/readable:297:9)
Aug 15 09:45:35 PM      at Readable.push (node:internal/streams/readable:234:10) {
Aug 15 09:45:35 PM    code: 'EAUTH',
Aug 15 09:45:35 PM    response: '535 5.7.0 (#AUTH005) Too many bad auth attempts.',
Aug 15 09:45:35 PM    responseCode: 535,
Aug 15 09:45:35 PM    command: 'AUTH PLAIN'
Aug 15 09:45:35 PM  }

I'm looking for ANY kind of solution, I just need it to be free.

Upvotes: 1

Views: 269

Answers (0)

Related Questions