Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - bwill

Pages: [1]
1
Email Protocols / Gmail only shows and downloads 2000 mails
« on: May 18, 2018, 09:44:49 AM »
Got an odd problem with Gmail. I don't think it's a Chilkat problem.

The user has about 13k mails in his inbox. When I get the number of mails in his inbox it's exactly 2000 mails and not 13k. I read about Gmail having limitations on sending email. But I didn't find anything concrete about downloading mails. Any ideas if this is a preferences setting in Gmail?

Regards

Beatrix Willius

2
Auth / OAuth and what then?
« on: March 17, 2018, 05:28:42 AM »
Hi,

I've successfully connected with OAuth to Gmail. But what comes afterwards?

I understand where I've got the access token and I'm supposed to save it.

Code: [Select]
Dim sbJson As New Chilkat.StringBuilder
sbJson.Append(oauth2.AccessTokenResponse)
sbJson.WriteFile("qa_data/tokens/_gmailSmtp.json","utf-8",False)

The next time I need to log in I would guess that I need this somewhere. But where? How do I use this instead of trying to log in again? Something like

Code: [Select]
if got access token then
 load access token from preferences into oauth
else
  do the connect stuff
end if

But even when being logging in getting the mailboxes fails. The code below:

Code: [Select]
CkoMailboxTask = CkoImap.ListMailboxesAsync("", "*")
call CkoMailboxTask.Run
While CkoMailboxTask.Finished <> True
  if globals.StopArchiving then
    if not CkoMailboxTask.Cancel then app.SleepCurrentThread(10)
    Return Nil
  end if
  CkoMailboxTask.SleepMs(25)
wend

if not CkoMailboxTask.TaskSuccess then
  globals.theErrorLog.LogItem(CurrentMethodName + " task didn't finish")
  Return Nil
end if

dim CkoMailboxes as new Chilkat.Mailboxes
if not CkoMailboxes.LoadTaskResult(CkoMailboxTask) then
  globals.theErrorLog.LogItem(CurrentMethodName + " wasn't able to load result from task") '<------ no mailboxes
  Retur
n Nil
end if

fails when loading the result of the task. A simple

dim theM as Chilkat.Mailboxes = CkoImap.ListMailboxes("", "*")

also doesn't work. Do I need to connect the Oauth to Chilkat.Imap?

Xojo 2017r3, 64bit, macOS 10.11., Chilkat plugin from feb 2018.

Mit freundlichen Grüßen/Regards

Beatrix Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals


3
Xojo / 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

Pages: [1]