Client: ImapClient

Isolated

Represents an IMAP Client, which interacts with an IMAP Server.

Constructor

Gets invoked during the email:ImapClient initialization.

init (string host, string username, string password, *ImapConfiguration clientConfig)
  • host string
  • Host of the IMAP Client

  • username string
  • Username of the IMAP Client

  • password string
  • Password of the IMAP Client

Remote Methods

receiveMessage

Reads a message.

close

Close the client.

receiveMessage

function receiveMessage(string folder, decimal timeout) returns Message | Error?
Isolated Function
Remote Function

Reads a message.

1email:Message|email:Error emailResponse = imapClient->receiveMessage();

Parameters

  • folder string (default DEFAULT_FOLDER)
  • Folder to read emails. The default value is INBOX

  • timeout decimal (default 0)
  • Polling timeout period in seconds.

Return Type

(Message | Error?)

An email:Message if reading the message is successful, () if there are no emails in the specified folder, or else an email:Error if the recipient failed to receive the message

close

function close() returns Error?
Isolated Function
Remote Function

Close the client.

1email:Error? closeResponse = imapClient->close();

Return Type

(Error?)

An email:Error if the recipient failed to close the client or else ()