C# .NET - Auto responder - Asked By sandip diyora on 06-Mar-12 12:33 AM

I am developing a referral system right now in that there is one Mail module. In that i need auto respond functionality.In auto respond functionality what i have to do is when new member join to the company then company should reply that particular member immediate that thank you for joining us and all this things.So now question is that how can i able to find that there is a request of member for joining in my Inbox ? so that i can reply. this thing i need to know automatically not manually.In short when any request from member then i informed automatically about that mail so that i can send mail automatically. Please reply me as soon as early.
[)ia6l0 iii replied to sandip diyora on 06-Mar-12 10:25 PM
Before looking at the solution, we need to be clear about certain things. Is the Referral system outside your mail client 
(outlook, lotus notes for e.g) and exchange server? I hope it is yes. 

And do you want to monitor the inbox in your application (Referral System), or your mail client (Outlook for example)?

If the answer is in your application, then you would need to handle it through polling. If it is a windows application, do a poll to the database every 5 minutes or so, to look for a new member, and use your "Mail module" to send "greetings". If it is a web application, do a constant check using a Json call and do as adviced above. 

If the answer is that you need to monitor your mail client like Outlook - then you have two choices.
a) Write a mail client Addin (like outlook addin) that constantly checks for mail with a particular subject or body in the inbox
b) And if it is Outlook, you can then use the Interop assemblies to talk to Outlook Inbox object and figure out if there are mails and take appropriate action. You need to use the "http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._items.find.aspx" Method to figure out the mails as per you need.

Thank you.