mn8 Language Reference | Index    

POP3Client

SUMMARY: ATTRIBUTES SUMMARY  NO ELEMENTS  NO CONSTRUCTORS  NO OPERATORS  METHODS SUMMARYDETAIL: ATTRIBUTE DETAILS  NO ELEMENTS  NO CONSTRUCTORS  NO OPERATORS  METHOD DETAILS

Description

The POP3Client concept implements the client side of the Internet POP3 Protocol defined in RFC 1939.
Have a lot of methods for :

See RFC 1939 for more details on the POP3 protocol.

Usage

Connect to 'host' named POP3 server and login with 'user' and 'pwd', and get content of all messages from the mailbox.

            $pop3 TYPEOF POP3Client
            $connected = $pop3.openConnection("pop3://hostName/")
            if $connected then [
                print "You are connected to POP3 server."
                $logined = $pop3.login( "userName, "passwd")
                if $logined then [
                    print "You are logined."
                    $messages = $pop3.getLinks

                    each $message in $messages do [
                        $nr = Integer.create ( $message.getTokens("(")/1.trim )
                        print $pop3.getMessage( $nr )
                    ]
                ] else [
                    print "Login failed. " + $pop3@errorMessage
                ]
            ] else [
                print "Conncetion failed. " + $pop3@errorMessage
            ]
        

Version: 0.1
Authors:Szabo Csaba
Inherits: Concept

Attribute List

 @errorMessage TYPEOF String LABEL "errorMessage"
top

Method List

closeConnection
Logicaldelete (Integer $messID)
StringgetLinks (Integer $messID)
SeriesgetLinks
StringgetMessage (Integer $messID)
Logicallogin (String $userName, String $password)
Logicallogout
LogicalopenConnection (String $url)
top
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getConceptsAtPath, getErrorHandler, getInheritedConcepts, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML

Detailed Attribute Info

@errorMessage

Label:errorMessage
Type:String
Is Static:false
Is Hidden:false
Show Empty:true

Stores that error message with which the last executed command returned.

top

Detailed Method Info

closeConnection
Exceptions:
closeConnection :
(Error)
If unable to close POP3 connection.

Close the current connection.

top
delete (Integer $messID)
Parameters:
$messID :The message ID to delete.
Returns: Logical
Exceptions:
POP3OperationFailed :
(Error)
If unable to delete message from the mailbox.

Returnes true if the deleting of the message with the specified ID was successfull, false otherwise.

top
getLinks (Integer $messID)
Parameters:
$messID :The message ID.
Returns: String
Exceptions:
POP3OperationFailed :
(Error)
If unable to get message form the mailbox.

Returns a string containing the number of the listed message and the size of the message in bytes.

top
getLinks
Returns: Series
Exceptions:
POP3OperationFailed :
(Error)
If unable to get message list form the mailbox.

Returns a series representing all messages in the order they appear in the mailbox, each containing the number of a message and its size in bytes. If there are no messages, this method returns a zero length series.

top
getMessage (Integer $messID)
Parameters:
$messID :The message ID.
Returns: String
Exceptions:
POP3OperationFailed :
(Error)
If unable to get message from the mailbox.

Returns the specified message content.

top
login (String $userName, String $password)
Parameters:
$userName :The user's name with which to connect.
$password :The user's password with which to connect.
Returns: Logical
Exceptions:
loginWarning :
(Warning)
If the specified user can not login into POP3 server.
loginFailed :
(Error)
If the login failed into POP3 server.

Returns true if the logging in with the specified $userName and $password was successfull, false otherwise.

top
logout
Returns: Logical
Exceptions:
logoutFailed :
(Error)
If the logout failed form POP3 server.

Returns true if the logging out was successfull, false otherwise.

top
openConnection (String $url)
Parameters:
$url :The url to the remote host.
Returns: Logical
Exceptions:
missingHost :
(Error)
If missing host name for POP3 connection.
connectionRefuzed :
(Error)
If the POP3 server refuzed connection.
unsupportedProtocol :
(Error)
If this protocol not supported by POP3Client.

Returns true if the connection to the remote host with the specified $url was successfull, false otherwise.

top