I'm trying to fetch the IMAP headers and the body (message & attachments) seperately.
Fetching the headers is no problem, but when I try to fetch the body Rebex.Net.Imap.DLL throws a System.InvalidOperationException.

 ConnectAndLogin();
 var message = _imap.GetMailMessage(uniqueId);

I have no idea if I did something wrong, or that it is a bug/error in the library...

asked 19 Oct '11, 09:36

TestCSSL's gravatar image

TestCSSL
183
accept rate: 0%

What does the exception message say? It's impossible to tell what is going on without this piece of information.

(19 Oct '11, 10:22) Lukas Pokorny ♦♦

An even better option would be to create a communication log using Imap object's LogWriter property (as described at http://www.rebex.net/kb/logging.aspx). Please create the log and either add it to your post or mail it to support@rebex.net for analysis. Thanks!

(19 Oct '11, 10:24) Lukas Pokorny ♦♦

According to the log you sent us, the exception message is "No folder is selected". This means that you have to select a folder first before calling a method such as GetMailMessage that works on the current folder. For example, if you need to access messages in your Inbox folder, call SelectFolder("Inbox") first:

ConnectAndLogin();
_imap.SelectFolder("Inbox")
var message = _imap.GetMailMessage(uniqueId);
link

answered 19 Oct '11, 18:03

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.4k28
accept rate: 31%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×76
×53

Asked: 19 Oct '11, 09:36

Seen: 269 times

Last updated: 19 Oct '11, 18:03