Click here to Skip to main content
14,978,905 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i am working in asp.net. i want to run a service when my inbox receives a new mail. i dont kn know how to identify my inbox arrives a new mail

What I have tried:

i tried timer to read mail.but i want to read my mail only after arriving new mail
Posted
Updated 30-Sep-20 3:22am

1 solution

You can only do this if the mailbox is using IMAP and has the "idle" feature installed. Google "c# imap idle notification" to find various ways of using this, if your target mailbox doesn't support idle then polling is the only other option.

Your other problem is that asp.net is not a platform that can support this kind of thing. Websites are a request\response technology, your code only runs when a user requests a url in their browser so you can't really have background tasks running reliably. If you are planning on using a Windows service then you'll need the service to do the listening\polling for new emails as that code will always be running.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900