Class TSakPOP (unit SakEmail)

Inherits from

TComponent

=============== SakPOP ===============

Constructors


constructor Create(AOwner: TComponent);

Public declarations

***************** TSakPOP *****************



Functions

procedure Connect;


procedure DeleteMessage( id : word);


function Init: word;


function Login: boolean;


procedure Quit;


function RetrieveAllMessages( var SakMsgList: TSakMsgList): integer;

agregar aPart.

function RetrieveHeaders( id : word): string;


function RetrieveMessage( id : word): TSakMsg;


procedure Base64Decode( var AttachedFile: TAttachedFile);

Protected declarations

procedure UUDecode( var AttachedFile: TAttachedFile);


procedure FDoAfterRetrieve;


procedure FDoBeforeRetrieve( id: word);


procedure FDoConnect( Sender: TObject; Socket: TCustomWinSocket);

Sergio

procedure FDoDecodeEnd;


procedure FDoDecodeProgress( Percent: word);


procedure FDoDecodeStart( FileName: string; BytesCount: longint);


procedure FDoDelete( id: word);


procedure FDoDisconnect( Sender: TObject; Socket: TCustomWinSocket);


procedure FDoErr( err: integer);


procedure FDoError( Sender: TObject; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer);


procedure FDoRetrieveProgress( Percent: word);


function FindInHeaders( const que: string; const strList: TStringList; var line: integer): boolean;

begin 600 n

function FindInStringList( const que: string; const strList: TStringList; var line, position: integer): boolean;

the method find of TStringList is useless in this case

function FindInStringListCS( const que: string; const strList: TStringList; var line, position: integer): boolean;

the method find of TStringList is useless in this case

function FindUUAttachs( const strList: TStringList; var line: integer; var FileName: string): boolean;

the first line (0) is 'begin 6xx bla bla'

function FReceiveTextFromSocket: string;


procedure FSendTextToSocket( const txt: string);


Properties

property DecodeProgressStep : word


property ErrorInFormatOfMsg : string


property Host : string


property IPAddress : string


property Passwd : string


property Port : string


property RetrieveProgressStep : word


property UserId : string

Published declarations

property Canceled : boolean


property Connected : boolean


property ErrorString : string


property MsgsCount : word


property POPError : boolean


property ReplyCode : string


property ReplyString : string


property SessionState : TSessionState


Events

event OnAfterRetrieve : TNotifyEvent


event OnBeforeRetrieve : TOnBeforeRetrieve


event OnConnect : TNotifyEvent


event OnDecodeEnd : TNotifyEvent


event OnDecodeProgress : TOnCodeProgressEvent


event OnDecodeStart : TOnCodeStartEvent


event OnDelete : TOnDeleteEvent


event OnError : TOnError


event OnQuit : TNotifyEvent


event OnRetrieveProgress : TOnCodeProgressEvent


Variables

FCanceled : boolean;


FConnected : boolean;


FDecodeProgress : word;


FDecodeProgressStep : word;


FErrorInFormatOfMsg : string;


FHost : String;


FIPAddress : string;


FMessagesDeleted : TStringList;


FMsgsCount : word;


FOnAfterRetrieve : TNotifyEvent;


FOnBeforeRetrieve : TOnBeforeRetrieve;


FOnConnect : TNotifyEvent;


FOnDecodeEnd : TNotifyEvent;


FOnDecodeProgress : TOnCodeProgressEvent;


FOnDecodeStart : TOnCodeStartEvent;


FOnDelete : TOnDeleteEvent;


FOnDisconnect : TNotifyEvent;


FOnError : TOnError;


FOnRetrieveProgress : TOnCodeProgressEvent;


FPasswd : string;


FPOPError : boolean;


FPOPErrorString : string;


FPort : string;


FReceivingMsg : boolean;


FReplyCode : string;


FReplyString : string;


FRetrieveProgress : word;


FRetrieveProgressStep : word;


FSessionState : TSessionState;


FSize : longint;


FSocket : TClientSocket;

Private declarations

FSocketStream : TWinSocketStream;


FStep : word;


FUserId : string;



Constructors


constructor Create(AOwner: TComponent);

Public declarations

***************** TSakPOP *****************


Functions


procedure Connect;


procedure DeleteMessage( id : word);


function Init: word;


function Login: boolean;


procedure Quit;


function RetrieveAllMessages( var SakMsgList: TSakMsgList): integer;

agregar aPart.free;


function RetrieveHeaders( id : word): string;


function RetrieveMessage( id : word): TSakMsg;


procedure Base64Decode( var AttachedFile: TAttachedFile);

Protected declarations


procedure UUDecode( var AttachedFile: TAttachedFile);


procedure FDoAfterRetrieve;


procedure FDoBeforeRetrieve( id: word);


procedure FDoConnect( Sender: TObject; Socket: TCustomWinSocket);

Sergio


procedure FDoDecodeEnd;


procedure FDoDecodeProgress( Percent: word);


procedure FDoDecodeStart( FileName: string; BytesCount: longint);


procedure FDoDelete( id: word);


procedure FDoDisconnect( Sender: TObject; Socket: TCustomWinSocket);


procedure FDoErr( err: integer);


procedure FDoError( Sender: TObject; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer);


procedure FDoRetrieveProgress( Percent: word);


function FindInHeaders( const que: string; const strList: TStringList; var line: integer): boolean;

begin 600 n


function FindInStringList( const que: string; const strList: TStringList; var line, position: integer): boolean;

the method find of TStringList is useless in this case


function FindInStringListCS( const que: string; const strList: TStringList; var line, position: integer): boolean;

the method find of TStringList is useless in this case


function FindUUAttachs( const strList: TStringList; var line: integer; var FileName: string): boolean;

the first line (0) is 'begin 6xx bla bla'


function FReceiveTextFromSocket: string;


procedure FSendTextToSocket( const txt: string);


Properties


property DecodeProgressStep : word


property ErrorInFormatOfMsg : string


property Host : string


property IPAddress : string


property Passwd : string


property Port : string


property RetrieveProgressStep : word


property UserId : string

Published declarations


property Canceled : boolean


property Connected : boolean


property ErrorString : string


property MsgsCount : word


property POPError : boolean


property ReplyCode : string


property ReplyString : string


property SessionState : TSessionState


Events


event OnAfterRetrieve : TNotifyEvent


event OnBeforeRetrieve : TOnBeforeRetrieve


event OnConnect : TNotifyEvent


event OnDecodeEnd : TNotifyEvent


event OnDecodeProgress : TOnCodeProgressEvent


event OnDecodeStart : TOnCodeStartEvent


event OnDelete : TOnDeleteEvent


event OnError : TOnError


event OnQuit : TNotifyEvent


event OnRetrieveProgress : TOnCodeProgressEvent


Variables


FCanceled : boolean;


FConnected : boolean;


FDecodeProgress : word;


FDecodeProgressStep : word;


FErrorInFormatOfMsg : string;


FHost : String;


FIPAddress : string;


FMessagesDeleted : TStringList;


FMsgsCount : word;


FOnAfterRetrieve : TNotifyEvent;


FOnBeforeRetrieve : TOnBeforeRetrieve;


FOnConnect : TNotifyEvent;


FOnDecodeEnd : TNotifyEvent;


FOnDecodeProgress : TOnCodeProgressEvent;


FOnDecodeStart : TOnCodeStartEvent;


FOnDelete : TOnDeleteEvent;


FOnDisconnect : TNotifyEvent;


FOnError : TOnError;


FOnRetrieveProgress : TOnCodeProgressEvent;


FPasswd : string;


FPOPError : boolean;


FPOPErrorString : string;


FPort : string;


FReceivingMsg : boolean;


FReplyCode : string;


FReplyString : string;


FRetrieveProgress : word;


FRetrieveProgressStep : word;


FSessionState : TSessionState;


FSize : longint;


FSocket : TClientSocket;

Private declarations


FSocketStream : TWinSocketStream;


FStep : word;


FUserId : string;