mscdex / node-imap

An IMAP client module for node.js.
MIT License
2.14k stars 379 forks source link

ECONNREFUSED error while trying to use imap #902

Open ProgramJack opened 1 year ago

ProgramJack commented 1 year ago

Hello. I am currently using Visual Studio Code with 18.16.0 Node. I am trying to use imap, but it keeps saying the error is "ECONNREFUSED". What might be the cause of this? I am providing the right details. Or should be at least.

var Imap = require('imap'),
    inspect = require('util').inspect;

var imap = new Imap({
    user: 'gmail@gmail.com',
    password: 'gmailpass',
    host: 'imap.gmail.com',
    port: 993,
    tls: true
});

Full error message:

errno: -4078,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: 'xxxxx',
  port: 993,
  source: 'socket'
mscdex commented 1 year ago

Check any firewalls or security software you have in place. Something is blocking your traffic.