# imap-checker

> Check the email server and return the matching emails

Latest version **0.0.8** (published 2021-04-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install imap-checker
pnpm add imap-checker
yarn add imap-checker
bun add imap-checker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2021-04-30 |
| First published | 2020-02-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Daniel Han |
| Maintainers | hex0cter |

## Links

- npm: https://www.npmjs.com/package/imap-checker
- Repository: https://github.com/scrive/imap-checker
- Homepage: https://github.com/scrive/imap-checker#readme
- Issues: https://github.com/scrive/imap-checker/issues
- npm.io page: https://npm.io/package/imap-checker

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [mailparser](https://npm.io/package/mailparser.md) ^3.2.0
- [imap-simple](https://npm.io/package/imap-simple.md) ^5.0.0

## Recent versions

- 0.0.8 (latest) — 2021-04-30
- 0.0.7 — 2021-04-23
- 0.0.6-3 — 2021-04-23
- 0.0.6-2 — 2021-04-22
- 0.0.6-1 — 2021-04-22
- 0.0.6 — 2020-03-27
- 0.0.5 — 2020-03-27
- 0.0.4 — 2020-03-25
- 0.0.3 — 2020-02-24
- 0.0.2 — 2020-02-20
- 0.0.1 — 2020-02-18

## README

# mail checker
[![npm version](https://badge.fury.io/js/imap-checker.svg)](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: '<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: '<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 <joe@example.com>`, just search it as `joe@example.com`.

---
_Source: https://npm.io/package/imap-checker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
