This project is read-only.

Issue with getting body from Exchange

Topics: Issues
Apr 7, 2014 at 10:45 PM
Edited Apr 7, 2014 at 10:46 PM
The body always contains " 1 fetch (" and the next email will be incremented " 2 fetch (" im not sure what would be causing this.

This happens with both text and html.

Im connecting to a 2010 Exchange Server. and using the

client.Behavior.AutoPopulateFolderMessages = true;
client.Behavior.MessageFetchMode = MessageFetchMode.Full;

Thank you in advance.
Coordinator
Apr 8, 2014 at 12:09 PM
Hi SupersumWeb,

this issue has already been reported and I'm workng on it. The progress is quite far already, will try to upload the update tonight.

Greets,

Pavel
Coordinator
Apr 8, 2014 at 8:17 PM
Good evening!

Please have a look at the latest code in the repository. Various fixes have been done. I'd be happy if you can test it and give some feedback!

Best regards,

Pavel
Apr 9, 2014 at 8:14 PM
Edited Apr 9, 2014 at 9:56 PM
Now there is no content in the body.

Just a reminder that this is a Exchange 2010 server.


Edit,

I just noticed, that if the email contains an image then it will work somewhat. I will still get "* n fetch (" in the body. But will also contain the email. The body will also be appended with the UID

Example:
  • 3 FETCH (
Test Content
UID 163
Coordinator
Apr 10, 2014 at 8:51 AM
Hi SupersumWeb,

is it possible to do a TeamViewer session, so I can step through the code when you're connected to the Exchange server on your machine?

Greets,

Pavel
Apr 10, 2014 at 3:05 PM
Sorry thats not possible, im using the component at a client location and they will not allow it. Im also not on site today but would like to get this resolved before im on site again. Im testing locally with gmail but when on-site im using exchange server.

from what i noticed when using the sample application, if the email contains a image or is a forward of another message it seems to return the email body. If i send a simple email then the body is empty.

If there is something you would like me to try, let me know.
Apr 10, 2014 at 9:22 PM
Hello,

I'm having the same issue while connecting on a Exchange 2010 server, but in my case when I tested with the new code, the Body showed the same value "* 1 fetch (".
If there's anything I can do to help fix the issue, please tell me.
Coordinator
Apr 10, 2014 at 10:10 PM
Hi cassiobsilva,

I'm working on an update now, will let you know as soon as it is available through the repository, so you can test it.

Greets,

Pavel
Coordinator
Apr 11, 2014 at 3:30 PM
Hi cassiobsilva,

I made another update on this issue, you can try the latest code from the repository.

Greets,

Pavel
Apr 12, 2014 at 4:40 AM
Hello Pavel,

Seems like it solved the issue. I'll run more tests and if something incorrect appears, I let you know.

Thanks.
Coordinator
Apr 12, 2014 at 10:45 AM
Hi cassiobsilva,

thanks, waiting for your feedback!
Apr 22, 2014 at 2:24 PM
Hello Pavel,

During the tests, the body of the message from a exchange serer show a little odd. I'm getting the message as EML and appending the content on a new message in another exchange server.
By the way, is there any better way to copy messages between servers?
This is a multipart message in MIME format

--00000000000000000000000000000000
charset: iso-8859-1
content-type: text/plain; charset="iso-8859-1"
content-transfer-encoding: quoted-printable

ENVELOPE ("Tue, 22 Apr 2014 10:11:27 -0300" "Testing" (("Cassio" NIL "cassio.bock" "outlook com")) NIL NIL (("cassio@domain.com" NIL "cassio" "domain.com")) NIL NIL NIL "<BAY176-W441B0A360D9BB7F05AA3FF3590@phx.gbl>")Sending a test message.                                      

--00000000000000000000000000000000
charset: iso-8859-1
content-type: text/html; charset="iso-8859-1"
content-transfer-encoding: quoted-printable

<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style><!--.hmmessage P{margin:0px;padding:0px}body.hmmessage{font-size: 12pt;font-family:Calibri}--></style></head><body class="hmmessage"><div dir="ltr"><font style="" face="Calibri">Sending a test message.<br id="FontBreak"></font>                                 </div></body></html> 

--00000000000000000000000000000000--
Coordinator
Apr 23, 2014 at 7:44 AM
Hi cassiobsilva,

I expect you're using the Message.ToEml method to get the message as EML? It is a bit buggy at the moment, so a better approach is using the Message.DownloadRawMessage method to get the EML data, and upload the message using the Folder.AppendMessage method:
var messages = client1.Folders.Inbox.Search("RECENT");
for(var i = 0; i < messages.Length; i++)
{
      var eml = messages[i].DownloadRawMessage();
      client2.Inbox.AppendMessage(eml);
}
Best regards,

Pavel
Apr 23, 2014 at 2:01 PM
Hi Pavel,
Using Message.DownloadRawMessage, I'm getting the almost the exact value, but in the end there's a little piece of data that remains unparsed, like this:
UID 230)
IMAPX245 OK FETCH completed.
Maybe I should open a issue about that, what do you think?
Coordinator
Apr 24, 2014 at 11:36 AM
Hi cassiobsilva,

yes, it's a bug, thank you! I opened an issue for this.

Greets,

Pavel