Friday, July 31, 2009

How do I automatically process an incoming mail on my Web Server using ASP.NET 2.0 ?

Hi all,





I've a website with webserver and mailserver on the same server. How do I process any incoming mail using ASP.NET 2.0. please note that I'm not asking for auto-respondars. This is greatly provided by the mail server and I can do the same in my mail server control pannel by logging in to the same.





For Ex:





I want some action to be done which may store or read some information in database ( SQL Server 2K ) and perform some work on the data that has come along with the mail.





Thanks..





Ruchit S.

How do I automatically process an incoming mail on my Web Server using ASP.NET 2.0 ?
Since an ASP.NET page has to be called in order to function, you really can't use it to handle incoming mail; you never know when a message will arrive.





You could put the page on a schedule to process mail, however; either triggering it via a cronjob on a LAMP server, or with a scheduled task to Internet Explorer on your Web server, or depending on the mail server you have, it might be able to trigger a browser visit to your page any time a message is received.





The library you need to work with mail messages is System.Net.Mail.





http://msdn2.microsoft.com/en-us/library...





UPDATE:





I've already explained how you can invoke the page in my answer.
Reply:http://www.codeproject.com/cs/internet/d...


No comments:

Post a Comment