Difference between revisions of "OverbyteIcsSmtpProt.pas"

From Overbyte
Jump to navigation Jump to search
(Created page with 'Main Page -> OverbyteIcsSmtpProt.pas == Overview == Based on ICS revision 1264 source - v8.18 {|Object:||TSmtpCli class implements the S…')
 
Line 16: Line 16:
 
  SmtpEMailSeparators = [';', ','];
 
  SmtpEMailSeparators = [';', ','];
 
  SmtpDefEncArray : array [0..3] of AnsiString = ('7bit', '8bit', 'quoted-printable', 'base64');
 
  SmtpDefEncArray : array [0..3] of AnsiString = ('7bit', '8bit', 'quoted-printable', 'base64');
=== Set Definitions ===
+
=== State / Set Definitions ===
 
  TSmtpDefaultEncoding = (smtpEnc7bit, smtpEnc8bit, smtpEncQuotedPrintable, smtpEncBase64);
 
  TSmtpDefaultEncoding = (smtpEnc7bit, smtpEnc8bit, smtpEncQuotedPrintable, smtpEncBase64);
 
  TSmtpSendMode = (smtpToSocket, smtpToStream, smtpCopyToStream);
 
  TSmtpSendMode = (smtpToSocket, smtpToStream, smtpCopyToStream);
Line 34: Line 34:
 
  TSmtpRcptToErrorAction = (srteAbort, srteRetry, srteIgnore);
 
  TSmtpRcptToErrorAction = (srteAbort, srteRetry, srteIgnore);
 
  TSmtpSslType = (smtpTlsNone, smtpTlsImplicit, smtpTlsExplicit);
 
  TSmtpSslType = (smtpTlsNone, smtpTlsImplicit, smtpTlsExplicit);
 +
 
=== Event Definitions ===
 
=== Event Definitions ===
 
  TSmtpBeforeFileOpenEvent = procedure(Sender : TObject; Idx : Integer; FileName : String; var Action : TSmtpBeforeOpenFileAction) of object;
 
  TSmtpBeforeFileOpenEvent = procedure(Sender : TObject; Idx : Integer; FileName : String; var Action : TSmtpBeforeOpenFileAction) of object;

Revision as of 19:04, 8 January 2016

Main Page -> OverbyteIcsSmtpProt.pas

Overview

Based on ICS revision 1264 source - v8.18

Support file attachement using MIME format (RFC-1521, RFC-2045)
Support authentification (RFC-2104)
Support HTML mail with embedded images.

Definitions

Here the definitions are sorted into more readable format:

Constant Definitions

SmtpEMailSeparators = [';', ','];
SmtpDefEncArray : array [0..3] of AnsiString = ('7bit', '8bit', 'quoted-printable', 'base64');

State / Set Definitions

TSmtpDefaultEncoding = (smtpEnc7bit, smtpEnc8bit, smtpEncQuotedPrintable, smtpEncBase64);
TSmtpSendMode = (smtpToSocket, smtpToStream, smtpCopyToStream);
TSmtpState = (smtpReady, smtpDnsLookup, smtpConnecting, smtpConnected, smtpInternalReady, smtpWaitingBanner, smtpWaitingResponse, smtpAbort, smtpInternalBusy);
TSmtpMimeState = (smtpMimeIntro, smtpMimePlainText, smtpMimeHtmlText, smtpMimeImages, smtpMimeAttach, smtpMimeDone);
TSmtpRequest = (smtpConnect, smtpHelo, smtpMailFrom, smtpVrfy, smtpRcptTo, smtpData, smtpQuit, smtpRset, smtpOpen, smtpMail, smtpEhlo, smtpAuth, smtpStartTls, smtpCalcMsgSize, smtpMailFromSIZE, smtpToFile, smtpCustom);
TSmtpProxyType = (smtpNoProxy, smtpSocks4, smtpSocks4A, smtpSocks5, smtpHttpProxy);
TSmtpFct = (smtpFctNone, smtpFctHelo, smtpFctConnect, smtpFctMailFrom, smtpFctRcptTo, smtpFctData, smtpFctVrfy, smtpFctQuit, smtpFctRset, smtpFctEhlo, smtpFctAuth ,smtpFctStartTls ,smtpFctCalcMsgSize ,smtpFctMailFromSIZE);
TSmtpFctSet = set of TSmtpFct;
TSmtpContentType = (smtpHtml, smtpPlainText);
TSmtpAuthType = (smtpAuthNone, smtpAuthPlain, smtpAuthLogin, smtpAuthCramMD5, smtpAuthCramSha1, smtpAuthNtlm, smtpAuthAutoSelect);
TSmtpShareMode = (smtpShareCompat, smtpShareExclusive, smtpShareDenyWrite, smtpShareDenyRead, smtpShareDenyNone);
TSmtpPriority = (smtpPriorityNone, smtpPriorityHighest, smtpPriorityHigh, smtpPriorityNormal, smtpPriorityLow, smtpPriorityLowest);
TSmtpEncoding = (smtpEncodeNone, smtpEncodeBase64, smtpEncodeQP);
TSmtpBeforeOpenFileAction = (smtpBeforeOpenFileNone, smtpBeforeOpenFileNext, smtpBeforeOpenFileAbort);
TSmtpAfterOpenFileAction = (smtpAfterOpenFileNone, smtpAfterOpenFileNext, smtpAfterOpenFileRetry, smtpAfterOpenFileAbort);
TSmtpRcptToErrorAction = (srteAbort, srteRetry, srteIgnore);
TSmtpSslType = (smtpTlsNone, smtpTlsImplicit, smtpTlsExplicit);

Event Definitions

TSmtpBeforeFileOpenEvent = procedure(Sender : TObject; Idx : Integer; FileName : String; var Action : TSmtpBeforeOpenFileAction) of object;
TSmtpAfterFileOpenEvent = procedure(Sender : TObject; Idx : Integer; FileName : String; E : Exception; var Action : TSmtpAfterOpenFileAction) of object;
TSmtpRcptToErrorEvent = procedure(Sender : TObject; ErrorCode : Word; RcptNameIdx : Integer; var Action : TSmtpRcptToErrorAction) of object;
TSmtpMessageDataSentEvent = procedure(Sender : TObject; Size : Integer) of object;
TSmtpFileOpenEvent = procedure(Sender : TObject; Idx : Integer; FileName : String; var Stream : TStream) of object;
TSmtpDisplay = procedure(Sender : TObject; Msg : String) of object;
TSmtpHeaderLineEvent = procedure(Sender : TObject; Msg : Pointer; Size : Integer) of object;
TSmtpProcessHeaderEvent = procedure(Sender : TObject; HdrLines : TStrings) of object;
TSmtpGetDataEvent = procedure(Sender : TObject; LineNum : Integer; MsgLine : Pointer; MaxLen : Integer; var More: Boolean) of object;
TSmtpRequestDone = procedure(Sender : TObject; RqType : TSmtpRequest; ErrorCode : Word) of object;
TSmtpAttachmentContentType = procedure(Sender : TObject; FileNumber : Integer; var FileName : String; var ContentType : String) of object;
TSmtpAttachmentContentTypeEh = procedure(Sender : TObject; FileNumber : Integer; var FileName : String; var ContentType : String; var AttEncoding : TSmtpEncoding) of object;
TSmtpAttachHeader = procedure(Sender : TObject; FileNumber : Integer; FileName : String; HdrLines : TStrings) of object;
TSmtpNextProc = procedure of object;

Support Class Definitions

TSmtpHeaderLines = class(TStringList)
TSmtpMessageText = class(TObject)
SmtpException = class(Exception);

Support Functions

function RFC822DateTime(t : TDateTime) : String;
function ParseEmail(FriendlyEmail : String; var FriendlyName : String) : String;
function GenerateMessageID : String;
function SmtpRqTypeToStr(RqType: TSmtpRequest): ShortString;
function SmtpCliErrorMsgFromErrorCode(ErrCode: Word): String;

Main Component Definitions

TCustomSmtpClient = class(TIcsWndControl) { Base component, implementing the transport, without MIME support }
TSmtpCli = class(TCustomSmtpClient) { Descending component adding MIME (file attach) support }
TSyncSmtpCli = class(TSmtpCli) { TSyncSmtpCli adds synchronous functions = reduced performance }
TCustomSslSmtpCli = class(TSyncSmtpCli) { adds SSL support to TSmtpCli }
THtmlSmtpCli = class(TCustomSslSmtpCli) { if you have enabled SSL support}
THtmlSmtpCli = class(TSyncSmtpCli) { if you have not enabled SSL support}
TSslHtmlSmtpCli = class(THtmlSmtpCli) { if you have enabled SSL support}