We have a Windows Service which checks an e-mail account regularly, every X seconds using a Timer. It manages to decrypt mails the first few times it runs, but after that it just reports "Could not decrypt e-mail" (see code below). If I restart the service, it will decrypt the e-mail, but after a few more "runs" it gives up again.
Here is a sample code (not complete) which runs at every run. A new instance of the MailMan object is instantiated every time the timer is elapsed. It runs on a Windows 2008 server in .Net 4.0.
So to the questions. Does anybody have a clue why this happens?
How can I find the reason why it can't decrypt the e-mail? LastErrorText will not give me anything after the call to GetMail.
asked Nov 28 '12 at 10:07
The decryption happens in the CopyMail. Therefore, you would want to examine the _mailman.LastErrorText after calling CopyMail.
answered Nov 28 '12 at 11:12