Unable to send the email from local development with nodemailer

Viewed 22

I'm using next-auth email provider to do the auth stuff. Everything goes well at first. But I've been unable to send the verification email from localhost:3000 on my local development maybe since I start to use VPN products on my Mac? Now it didn't work even if I disabled the VPN or rebooted my computer(With the same config, things still work in production). Here's the error msg:

{
  error: {
    message: 'Unexpected socket close',
    stack: 'Error: Unexpected socket close\n' +
      '    at Timeout._onTimeout (/Users/mingyang.yuan/Documents/Projects/xandsherry/node_modules/.pnpm/nodemailer@6.7.8/node_modules/nodemailer/lib/smtp-transport/index.js:190:31)\n' +
      '    at listOnTimeout (node:internal/timers:557:17)\n' +
      '    at processTimers (node:internal/timers:500:7)',
    name: 'Error'
  },
  providerId: 'email',
  message: 'Unexpected socket close'
}

I'm not sure if it's the VPN or something else that causes the problem. Still have no idea how to debug or fix this after searching on the Internet so far. Could you guys give me some clue about this(Maybe like how could the VPN affect the local development with nodemailer)? Thanks a lot.

0 Answers
Related