receiving email in ASP.NET - how do I schedule checking?
-
I'm new to ASP.NET so any help pointing me in the right direction would be great! I've figured out how to send and receive email (sending using the built-in .NET classes, and receiving using the AdvancedIntellect aspNetPOP3 component, since I couldn't see any built-in classes for this). My problem is I don't know how to make the website check for the email on regular basis. Essentially what I want to do is have the website check the email (POP) server (every 30 seconds or so?) check the subject (etc) of the email, and then send a response email with some appropriate data from my database. Should I setup a timer? Is this "not recommended" for an asp.net application, and should be done some other way? Thanks Warren
Need Icons? Huge list of Stock Icon collections (free and commercial): www.IconsReview.com
-
I'm new to ASP.NET so any help pointing me in the right direction would be great! I've figured out how to send and receive email (sending using the built-in .NET classes, and receiving using the AdvancedIntellect aspNetPOP3 component, since I couldn't see any built-in classes for this). My problem is I don't know how to make the website check for the email on regular basis. Essentially what I want to do is have the website check the email (POP) server (every 30 seconds or so?) check the subject (etc) of the email, and then send a response email with some appropriate data from my database. Should I setup a timer? Is this "not recommended" for an asp.net application, and should be done some other way? Thanks Warren
Need Icons? Huge list of Stock Icon collections (free and commercial): www.IconsReview.com
Well, depending on the circumstances, you might just want a console application or windows service running on the server to periodically check your POP mail.
-
Well, depending on the circumstances, you might just want a console application or windows service running on the server to periodically check your POP mail.
Mike Ellison wrote:
a console application or windows service running on the server
That's what I was thinking of as an alternative, but I didn't know if those (i.e. a Windows service) are typically available in a hosted environment??? Do you know if that is typically the case? Having previously been responsible for keeping a server going, I really want to use a hosted environment where someone else keeps the thing patched (etc).
Need Icons? Huge list of Stock Icon collections (free and commercial): www.IconsReview.com
-
Mike Ellison wrote:
a console application or windows service running on the server
That's what I was thinking of as an alternative, but I didn't know if those (i.e. a Windows service) are typically available in a hosted environment??? Do you know if that is typically the case? Having previously been responsible for keeping a server going, I really want to use a hosted environment where someone else keeps the thing patched (etc).
Need Icons? Huge list of Stock Icon collections (free and commercial): www.IconsReview.com
It would be worth discussing it with your host; your host may very well provide some kind of scheduled task service themselves. There are approaches to use though if your requirement has to be within the context of ASP.NET code. You could start a new thread in the Application.Start event to poll for your emails. This article shows an example of that approach: http://www.angrycoder.com/article.aspx?cid=5&y=2003&m=4&d=11[^]. As the article author points out, there are some pitfalls to this approach, but you can decide if it will work for your setup.