[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).
[Var: 'myPOP' = (Email_POP: -Host='pop.example.com', -Username='Example', -Password='Example')] [Iterate: $myPOP, (Var: 'ID')] [Var: 'Msg' = (Email_Parse: $myPOP->Retrieve)] [$myPOP->Delete] ... Process Message ... [/Iterate] [$myPOP->Close]
|-Host||The host name or IP address of the POP server.|
|-Port||The port for the POP server (defaults to 110).|
|-Username||The username for an account on the POP server.|
|-Password||The password for the account on the POP server.|
|-APOP||If supported by the server, APOP authentication is used by default. Set this parameter to false to disable APOP.|
|-Get||The action to perform when ->Get is called. Defaults to UIDL. Can be set to retrieve, delete, headers, or top#.|
|-Timeout||The timeout for the POP server in seconds (defaults to 15).|
|-Log||Set to true for detailed logging.|
See the Lasso 8 Language Guide for examples of how to use this tag.
|Implementation||LDML||Sets||Lasso 8.5, Lasso 8.0|
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.