question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to listen for new emails?

See original GitHub issue

@mscdex

I open the inbox and then search for new emails :

imap.once("ready", () => {
  openInbox((err, mailbox) => {
    imap.search(["NEW"], (err, uids) => {
      console.log("Searched ...");
      console.log(uids);
    });
  });
});

and I keep the session/connection opened and then send a new email to my self but it won’t be recieved by imap ?!!

I never close the connection

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
guruprascommented, Mar 23, 2020

Could you share how you solved this issue? I’m very new to imap, and I’m trying to achieve the same thing.

mail(< integer >numNewMsgs) - Emitted when new mail arrives in the currently open mailbox.

As a result, I’m receiving 1 most of the times as well. I don’t quite know how to fetch the content of this new email.

0reactions
dzgcommented, Feb 17, 2022

I would also like to do the same … can someone share code? I want to run a function on each new message. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to listen for incoming emails in python 3? - Stack Overflow
Use the email.message.walk() method (new API) to run & filter message parts. Replace the legacy email API calls with the new ones as...
Read more >
Listen to your Outlook email messages - Microsoft Support
Let Outlook read your messages to you. On the Home tab, select Read Aloud. The Read Aloud controls appear in the upper right...
Read more >
How can I programmatically listen for new emails in my gmail ...
I need to programmatically listen for new emails on a gmail account and check to see if that email is of interest.
Read more >
email-listener - PyPI
email_listener is a Python package for listening in an email folder and processing incoming emails by scraping them, and optionally processing them with...
Read more >
How to Listen to Your Outlook Messages - YouTube
How to Listen to Your Outlook MessagesThis is a very quick video on how you listen to an Outlook email using read aloud....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found