(PureBasic) IMAP NOOP Command
Demonstrates how to send an IMAP NOOP command using SendRawCommand.
IncludeFile "CkImap.pb"
Procedure ChilkatExample()
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
imap.i = CkImap::ckCreate()
If imap.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
; Connect to an IMAP server.
; Use TLS
CkImap::setCkSsl(imap, 1)
CkImap::setCkPort(imap, 993)
success.i = CkImap::ckConnect(imap,"imap.someMailServer.com")
If success <> 1
Debug CkImap::ckLastErrorText(imap)
CkImap::ckDispose(imap)
ProcedureReturn
EndIf
; Login
success = CkImap::ckLogin(imap,"****","****")
If success <> 1
Debug CkImap::ckLastErrorText(imap)
CkImap::ckDispose(imap)
ProcedureReturn
EndIf
; Send a NOOP command
resp.s = CkImap::ckSendRawCommand(imap,"NOOP")
Debug resp
; Disconnect from the IMAP server.
success = CkImap::ckDisconnect(imap)
CkImap::ckDispose(imap)
ProcedureReturn
EndProcedure
|