login about faq

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.

var _mailman = new MailMan();
...set account info...
    EmailBundle bundle = _mailman.CopyMail();
    if (bundle == null || bundle.MessageCount == 0)           

    for (i = 0; i <= bundle.MessageCount - 1; i++)
        Email email = bundle.GetEmail(i);
        if (email.ReceivedEncrypted && !email.Decrypted)
           _log.Error("Could not decrypt e-mail");
        ...process email...

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

sdybvik's gravatar image


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

chilkat's gravatar image

chilkat ♦♦

I have sent some log files with LastErrorText to the support account.

(Nov 29 '12 at 06:17) sdybvik
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Nov 28 '12 at 10:07

Seen: 960 times

Last updated: Nov 29 '12 at 06:17

powered by OSQA