Lasso Soft Inc. > Home

[ email_pop ]

Method

[Email_POP] allows a POP connection to be opened to a remote mail server. The type instance represents the POP connection and the member tags allow different operations to be performed on the POP server.

The tag should be called with a -Host name that specifies the host name or IP address of the POP server, and a -Username and -Password to access the server. These standard parameter are all that is required to access most POP servers.

The default port is 110 or a different port can be specified using an optional -Port parameter. By default APOP authentication is used (if the server supports it), but this can be turned of by specifing -APOP=False. The timeout for the remote server can be modified using -Timeout=Seconds (defaults to 15). Detailed logging can be turned on using -Log=True.

The [Email_POP] type allows the [Email_POP->Get] tag to be customized so that [Iterate] ... [/Iterate] will perform the desired operation automatically. By default [Email_POP->Get] is set to get the Unique ID of the current message. It can also be set to 'retrieve' the current message, 'delete' the current message, get just the 'headers' for the current message or get the first 'top#' lines of the message.

Once the POP connection has been established [Email_POP->Size] reports how many messages are waiting on the server. [Email_POP->Retrieve] can be used to fetch a message by position (and an option second parameter specifies the maximum number of lines to retrieve). [Email_POP->Headers] can be used to fetch the headers a message by position. [Email_POP->Delete] can be used to delete a message by position. And, [Email_POP->UIDL] can be used to return the unique ID of a message by position. The individual messages are usually passed into [Email_Parse] for further processing

Alternately, [Iterate] ... [/Iterate] can be used to cycle through all the available messages on the POP server. The operation specified in the -Get parameter (unique ID by default) is performed for each message. The other member tags can be used without a position parameter to retrieve, delete, or get the headers of the current message. The individual messages are usually passed into [Email_Parse] for further processing

Finally, the [Email_POP->Close] tag should be used to close the connection with the remote host. Any pending deletes will be performed when the connection is closed. The [Email_POP->Cancel] tag can be used to close the connection without performing any pending deletes.

Some additional tags provide debugging information. [Email_POP->LastError] returns the last error message received by the type. [Email_POP->Errors] returns an array of all error messages received by the type. [Email_POP->Results] returns an array of all results received by the type (errors and success reports).

  • Syntax
  • Methods
  • Traits
local(myPOP = Email_POP(-Host='pop.example.com', -Username='Example', -Password='Example'))
loop(#myPOP->size) => {
    local(Msg = Email_Parse(#myPOP->retrieve(loop_count)))
    #myPOP->delete(loop_count)
    // ... Process Message ...
}
#myPOP->Close
Has methods:
Has traits:
Examples

No examples found

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2014 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft