Binding to a native implementation of POP3 receiver.

Should be created using TubMailReceiver method of module:@unitybase/mailer module

# new TubMailReceiver (paramsObjObject)

Arguments:
  • paramsObj: Object
    • hostString

      host of mail server

    • portString

      port of mail server

    • user=''String

      user login on mail server

    • password=''String

      user password on mail server

    • tlsBoolean

      use tls on server request. OpenSSL libraries version >= 0.9.7 must be installed - see package README.md for details

    • fullSSLBoolean

      Setup TLS before any POP3 command

    parameters object

Methods

# deleteMessage (indexNumber) → Boolean static

Mark the message to delete. The message will be removed indeed, when reconnect to the server or the object is destroyed. For destroy object immediately use freeNative, for reconnect use reconnect() method

Return:

True if successfully, in opposite case raise exception

Arguments:
  • index: Number

    Index of mail message on server. Indexes starts from 1

# getMessagesCount () → Number static

Count of messages on server

# getMessageSize (indexNumber) → Number static

Get size of message

Arguments:
  • index: Number

    Index of mail message on server. Indexes starts from 1

# receive (indexNumber) → TubMimeMessBind static

Receive message from server

Arguments:
  • index: Number

    Index of mail message on server. Indexes starts from 1

# reconnect () → Boolean static

Reconnect to mail server. Get new messages from server, delete marked for delete messages.

Return:

True if successfully, in opposite case raise exception

# top (indexNumber, maxLinesNumber) → TubMimeMessBind static

Receive message headers and first maxLines strings of message

Arguments:
  • index: Number

    Index of mail message on server. Indexes starts from 1

  • maxLines: Number

    Count of message lines to receive