I'm trying to realize a web application with asp.net mvc in which I must receive email 24/7 and do some treatment and notify the specific user .My question is how can I run a thread all time even if the user is not logged.
for the email reception I use S22.Imap
:
AutoResetEvent ReconnectEvent = new AutoResetEvent(false);
ImapClient Client;
while (true)
{
Client = new ImapClient("imap.gmail.com", 993, "login", "password", AuthMethod.Login, true);
ReconnectEvent.WaitOne();
}