Advertisement
Guest User

Untitled

a guest
Dec 9th, 2017
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1.  
  2. `var Imap = require('imap'),
  3. inspect = require('util').inspect;
  4. var imap = new Imap({
  5. user: 'xxxxxxxxx@domain.com',
  6. password: 'xxxxxxxxxx',
  7. host: 'some_host',
  8. port: 993,
  9. tls: true,
  10. tlsOptions: {
  11. rejectUnauthorized: false
  12. }
  13. });
  14. var fs = require('fs');
  15. function openInbox(cb) {
  16. imap.openBox('INBOX', false, cb);
  17. }
  18. imap.once('ready', function() {
  19. openInbox(function(err, box) {
  20. if (err) throw err;
  21. imap.search(["ALL", ["FROM", "someemail@domain.com"]],
  22. function(err, results) {
  23. //some stuff
  24. });
  25. });
  26. });
  27. imap.connect();`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement