Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `var Imap = require('imap'),
- inspect = require('util').inspect;
- var imap = new Imap({
- user: 'xxxxxxxxx@domain.com',
- password: 'xxxxxxxxxx',
- host: 'some_host',
- port: 993,
- tls: true,
- tlsOptions: {
- rejectUnauthorized: false
- }
- });
- var fs = require('fs');
- function openInbox(cb) {
- imap.openBox('INBOX', false, cb);
- }
- imap.once('ready', function() {
- openInbox(function(err, box) {
- if (err) throw err;
- imap.search(["ALL", ["FROM", "someemail@domain.com"]],
- function(err, results) {
- //some stuff
- });
- });
- });
- imap.connect();`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement