Results 1 to 1 of 1

Thread: POP3 client with SSL

  1. #1

    Thread Starter
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    POP3 client with SSL

    This is class that allows you to retrieve email from a pop3 server. I have only tested it on my server so since the pop3 return strings are only loosely defined you may have to tweek some of the code to work with your server.

    I have not done any work on interpreting the body of the message yet. Often messages are sent in several different formats at the same time such as HTML and plain text. Examining the ContentType property of the returned message will let you know what format(s) the message is in.

    I have attached the class and a demo program that shows you how to use the class to download messages and check for new messages.


    Class Description

    Constructor
    clsSSLPop3([UseSSL],[LogFileName]) - Initializes a new instance of the clsPop3 class.
    UseSSL - A boolean variable that determines whether to communicate with the server over a secure socket layer or not. Defaults to False.

    LogFileName - A String that defines a log file to use for debugging purposes. If not set no logging is performed.
    Properties

    isConnected - A boolean that returns whether or not you are connected to the server.

    Messages - Returns a collection of messages that have been returned from the server. The messages are of type clsMessage(see below).

    MessageCount - Returns the number of messages on the server.

    Methods

    Connect([Server],[User],[Password]) - Makes a connection to the server and logs on to your account. If any of the optional parameters are omitted then the user will be prompted for a value. Before any actions can be performed you must connect to the server. The proper way to use the class is to connect, perform action and then Quit.
    Server - The server name or IP address.
    User - The user's login ID.
    Password - The user's password
    DeleteMessage(msgNumber) - Deletes the message whos number corresponds to msgNumber from the server.

    Dispose() - Call this method when through with the class to ensure resources are properly freed.

    Quit() - Logs off the server.

    getAllMessages() - Downloads all messages from the server and fills the Messages collection.

    getNewMessages() - Queries the server for new messages that are not already in the Message collection. If any are found they are downloaded and put into the collection. Returns True if any new messages were downloaded.

    getMessage(msgNumber) - Downloads a single message from the server.

    getHeader(msgNumber, [nLines]) - Downloads only the message header and nLines of the body. If nLines is omitted, then no part of the body is downloaded.

    getUIDL(msgNumber) - Returns a unique ID String for the message. This string is useful for determining whether new messages are on the server.

    getAllMsgIDs() - Returns a collection of UIDLs for all messages.

    UndoDelete() - Undoes all deletions performed during the current login session.
    Events

    popError(Description) - Raised when the class has a non-fatal error to report.

    popinfo(message) - Raised to report server responses and non-error messages.

    popVerifyDelete(MsgNumber, Cancel) - Raised before deleting a message from the server. If the user sets Cancel to true the message will not be deleted.

    popNewMessage(Message) - Raised when a call to getNewMessages returns a message.
    Internal Classes

    clsMessage - Holds the parsed data from a message

    Properties
    Index - The number of the message on the server.
    sendDate - The date the message was sent.
    MessageID - The message ID from the header.
    UIDL - The Unique ID returned by a call to getUIDL.
    whomTo - Who the message was sent to.
    From - Who the message was sent from
    ReplyTo - The Reply To field in the header.
    Body - The body of the message. Note further processing may need to be done to the body to make it readable depending on the ContentType field.
    isValid - Once the message fields have been set this value becomes true.
    Subject - The message subject.
    MIMEversion
    XmailerInfo
    ContentType
    ContentTransferEncoding



    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width