Author Topic: Still problems  (Read 172 times)

bwill

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Still problems
« on: December 01, 2017, 01:02:36 AM »
I still haven't solved the problem that we discussed at http://chilkatforum.com/questions/12921/another-empty-mail-with-fetchsingleasmimeasync

This occurs for me again. Also I've got 2 customers with the same problem.

You said

Quote
I tested, and everything looked fine to me. The email in question is a multipart/alternative, but with only one alternative body, which is a text/plain body. There is no HTML body in this particular email. You can examine the MIME. If you're calling a method such as email.GetHtmlBody, then it will certainly return nothing because there's no HTML body..

See https://www.example-code.com/xojo/email_body.asp

One can't assume an HTML body exists (or that a plain-text body exists..)

Does that explain the problem, or is it something else?

However, this doesn't explain my problems.

- The problem always occurs for me for the same mail.
- I'm using FetchSingleAsMimeAsync and the result is blank. No email.GetHtmlBody involved.
- The mails on the test account don't change much. There are no new mails.

Am I doing something wrong?

1) I do a message set and count the mails:

  CkoMessageSet = new Chilkat.MessageSet
  CkoMessageSet = CkoImap.Search("NOT DELETED", True)
  NoOfMails = CkoMessageSet.Count

2) I get number of headers and check if the mails are available in the database or not.

3) If the mail is not in the database then I get the mail:

Code: [Select]
dim messageID as Integer = CkoMessageSet.getID(counter - 1)
CkoMailTask = CkoImap.FetchSingleAsMimeAsync(messageID, True)
CkoImap.ReadTimeout = 60
call CkoMailTask.run
While CkoMailTask.Finished <> true
  CkoMailTask.SleepMs(50)
wend

if not CkoMailTask.TaskSuccess then
  Globals.theErrorLog.LogItem(CurrentMethodName + " " + MailboxPath +  " task didn't finish")
  Return ""
end if

dim theBody as String = CkoMailTask.GetResultString
'theBody is empty here

Regards

Beatrix Willius