https://github.com/scrive/imap-checker
Check the IMAP server and return the matching emails.
https://github.com/scrive/imap-checker
automation automation-test email imap imap-checker imap-client nodejs
Last synced: about 1 year ago
JSON representation
Check the IMAP server and return the matching emails.
- Host: GitHub
- URL: https://github.com/scrive/imap-checker
- Owner: scrive
- License: mit
- Created: 2020-02-18T17:36:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T00:38:19.000Z (over 3 years ago)
- Last Synced: 2025-04-02T06:21:35.996Z (about 1 year ago)
- Topics: automation, automation-test, email, imap, imap-checker, imap-client, nodejs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/imap-checker
- Size: 88.9 KB
- Stars: 3
- Watchers: 26
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mail checker
[](https://badge.fury.io/js/imap-checker)
Check the IMAP server and return the first matching email.
## How to use
```javascript
var imapChecker = require('imap-checker');
const imapConfig = {
user: "user@gmail.com",
password: "password",
host: "imap.gmail.com",
port: 993,
tls: true,
tlsOptions: { rejectUnauthorized: false }
};
imapChecker.checkMail(imapConfig, {
timeout: 30000,
subject: '',
to: 'john@gmail.com',
from: 'bob@gmail.com',
interval: 2000
})
.then(email => console.log('>>>', email));
```
Or in ES6:
```javascript
import imapChecker from 'imap-checker';
const imapConfig = {
user: "user@gmail.com",
password: "password",
host: "imap.gmail.com",
port: 993,
tls: true,
tlsOptions: { rejectUnauthorized: false }
};
const email = await imapChecker.checkMail(imapConfig, {
timeout: 30000,
subject: '',
to: 'john@gmail.com',
from: 'bob@gmail.com',
interval: 2000,
since: 24 * 3600 * 1000,
debug: true
});
console.log('>>>', email);
```
Different formats of email addresses are supported. For example, if you are looking for emails with sender's address as `Joe Doe `, just search it as `joe@example.com`.