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.
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
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:
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.comMail Archiver X: The email archiving solution for professionals