TubMailReceiverBind

@unitybase/mailer~ TubMailReceiverBind

Binding to a native implementation of POP3 receiver.

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

Constructor

new TubMailReceiverBind(paramsObj)

Arguments:
  1. paramsObj (Object)  parameters object
    Properties
    1. host (String)  host of mail server
    2. port (String)  port of mail server
    3. [user=''] (String)  user login on mail server
    4. [password=''] (String)  user password on mail server
    5. [tls=false] (Boolean)  use tls. In module:@unitybase/mailer tls is not implemented so you will get an exception when set this value true. For using tls use module:@unitybase/mailer-ssl class

Methods

getMessagesCount()Number static

Count of messages on server

getMessageSize(index)Number static

Get size of message
Arguments:
  1. index (Number)  Index of mail message on server. Indexes starts from 1

receive(index)TubMimeMessBind static

Receive message from server
Arguments:
  1. index (Number)  Index of mail message on server. Indexes starts from 1

top(index, maxLines)TubMimeMessBind static

Receive message headers and first maxLines strings of message
Arguments:
  1. index (Number)  Index of mail message on server. Indexes starts from 1
  2. maxLines (Number)  Count of message lines to receive

deleteMessage(index)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
Arguments:
  1. 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.