亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? smtpprot.pas

?? 包含常用Internet協(xié)議TCP,UDP、HTTP、FTP、Telnet等
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
{*_* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


Author:       Fran鏾is PIETTE
Object:       TSmtpCli class implements the SMTP protocol (RFC-821)
              Support file attachement using MIME format (RFC-1521)
Creation:     09 october 1997
Version:      2.17
EMail:        http://users.swing.be/francois.piette  francois.piette@swing.be
              http://www.rtfm.be/fpiette             francois.piette@rtfm.be
              francois.piette@pophost.eunet.be
Support:      Use the mailing list twsocket@rtfm.be See website for details.
Legal issues: Copyright (C) 1997-2000 by Fran鏾is PIETTE
              Rue de Grady 24, 4053 Embourg, Belgium. Fax: +32-4-365.74.56
              <francois.piette@pophost.eunet.be>

              This software is provided 'as-is', without any express or
              implied warranty.  In no event will the author be held liable
              for any  damages arising from the use of this software.

              Permission is granted to anyone to use this software for any
              purpose, including commercial applications, and to alter it
              and redistribute it freely, subject to the following
              restrictions:

              1. The origin of this software must not be misrepresented,
                 you must not claim that you wrote the original software.
                 If you use this software in a product, an acknowledgment
                 in the product documentation would be appreciated but is
                 not required.

              2. Altered source versions must be plainly marked as such, and
                 must not be misrepresented as being the original software.

              3. This notice may not be removed or altered from any source
                 distribution.

              4. You must register this software by sending a picture postcard
                 to the author. Use a nice stamp and mention your name, street
                 address, EMail address and any comment you like to say.

Updates:
Oct 25, 1997  Added the OnHeaderLine event to allow modification/deletion of
              header lines.
Oct 26, 1997  V1.00 Released
              Changed the OnGetData event arguments to have code compatible
              between 16 and 32 bit versions (replaced string with PChar).
Jan 10, 1998  V1.01 Added a Port property
Feb 14, 1998  V1.02 Added an intermeditae TCustomSmtpClient in order to
              support MIME in the TSmtpCli. I implemented MIME with the
              help of code donated by Brad Choate <choate@delphiexchange.com>
              Mime is used for file attachement.
              Added a SetRcptName to copy values from a string list in place
              of copying the string list reference.
Feb 15, 1998  V1.03 Added a CharSet property, defaulting to iso-8859-1
Mar 02, 1998  V1.04 Corrected result for QUIT command.
              Marcus Schmutz <schmutz@kwsoft.de>
Mar 06, 1998  V1.05 Use OnDataSent event to prenvent over-buffering
Mar 15, 1998  V1.06 Implemented the Date header line
Apr 01, 1998  V1.07 Adapted for BCB V3
Apr 10, 1998  V1.08 Corrected DayNames: sunday is day 1, saturday is day 7.
              Changed UUEncode procedures to virtual methods to ease component
              inheritance.
Apr 26, 1998  V1.09 Ignore any empty file name (a very common error !)
              Check if file exists and raise an exception if not.
              Made Rfc822DateTime public.
              Added Rset method from Victor Garcia Aprea <vga@overnet.com.ar>
              Added Abort procedure to close the socket and abort any operation
              Made the underlaying TWSocket accessible using a property.
Apr 28, 1998  V1.10 Reset FTimeOutFlag in the mail procedure.
May 05, 1998  V1.11 Handled correctly lines beginning with a dot.
May 21, 1998  V1.12 Check for nil argument in SetEMailFiles
              Added OnCommand and OnResponse events.
              Added SendDataLine procedure (same as SendCommand, but do not
              trigger OnCommand event) used for header and message lines.
Jul 29, 1998  V2.00 Asynchronous functions and new TSyncSmtpCli component
              to be a placer holder for synchronous version.
              Renamed source file from SmtpCli to SmtpProt.
Aug 06, 1998  V2.01 Made HighLevelAsync public and added smtpCustom to be used
              for custom calls to HighLevelAsync.
Sep 22, 1998  V2.02 Removed useless Wait unit from the uses clause.
Oct 04, 1998  V2.03 Checked for Error in TriggerRequestDone.
Oct 11, 1998  V2.04 Removed -1 in DataNext. Thanks to Dennis V. Turov
              <chip@quorum.ru> for finding this bug.
Nov 22, 1998  V2.05 Implemented VRFY command with code proposed by
              DZ-Jay <dz@caribe.net> but use HdrTo property as name to verify.
Nov 29, 1998  V2.06 Added SetErrorMessage in WSocketSessionConnected when an
              error occured. Thanks to DZ-Jay.
              Changed FMimeBoundary format to use numbered month instead of
              month names. Thanks to Dmitry Kislov <kislov@tekom.odessa.ua> who
              found that some foreign charsets are invalid in mime boundaries.
Dec 22, 1998  V2.07 Handle exception when connecting (will be triggered when
              an invalid port has been given).
              Force readonly when reading attached files.
              Added ContentType property as suggested by Henri Fournier
              <hfournier@home.com>
Feb 13, 1999  V2.08 Published the state property and OnSessionConnected,
              OnSessionClosed events.
Feb 27, 1999  V2.09 Added Connected property.
              Added code from Larry Pesyna <ldpesyna@aep.com> to handle time
              zone bias.
              Added OnAttachContentType event. Thanks to Vladimir M.
              Zakharychev <zak@dzbjaro.bertelsmann.de> for his suggestion.
              Added ReplyTo and ReturnPath properties. Thanks to Eric Bullen
              <eric@thedeepsky.com> for his code.
Mar 06, 1999  V2.10 Conditional compile to remove timezone code unsupported by
              Delphi 1.
Mar 09, 1999  V2.11 Made state property [really] published.
Mar 27, 1999  V2.12 Published OnProcessHeader
              Changed sign for time zone bias (thanks to Larry Pesyna).
May 10, 1999  V2.13 'daylight' functionality for timezonebias function.
              Thanks to Bernhard Goebel <Bernhard.Goebel@t-online.de>
              Do not set FRequestType in Connect when called from HighLevel
              function. Thanks to Eugene V. Krapivin <evk@tagil.ru>.
May 18, 1999  V2.14 Added Sender field.  If ommited, the sender is becomes
              HdrFrom. Jon Glazer <jglazer@adconn.com>
Jul 30, 1999  V2.15 Added MailMessage property by Thomas Kvamme
              <thokvamm@online.no>. MailMessage property can be used with
              OnGetData event. If both are used, MailMessages lines appears
              before lines got by OnGetData.
Oct 02, 1999  V2.16 Added OnAttachHeader event as suggested by Vladimir M.
              Zakharychev <zak@dzbjaro.bertelsmann.de>
              Accept friendly EMail addresses. Thanks to Thierry De Leeuw
              <thierry.deleeuw@proxis.be> for his code.
Nov 01, 1999  V2.17 Made all fields protected to easy component inheritance.

 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
unit SmtpProt;

interface

{$B-}           { Enable partial boolean evaluation   }
{$T-}           { Untyped pointers                    }
{$X+}           { Enable extended syntax              }
{$IFNDEF VER80} { Not for Delphi 1                    }
    {$H+}       { Use long strings                    }
    {$J+}       { Allow typed constant to be modified }
{$ENDIF}
{$IFDEF VER110} { C++ Builder V3.0                    }
    {$ObjExportAll On}
{$ENDIF}
{$IFDEF VER125} { C++ Builder V4.0                    }
    {$ObjExportAll On}
{$ENDIF}

uses
    WinTypes, WinProcs, SysUtils, Messages, Classes, Graphics, Controls,
    Forms, Dialogs, Menus, WSocket, WinSock;

const
  SmtpCliVersion     = 217;
  CopyRight : String = ' SMTP component (c) 1997-2000 F. Piette V2.17 ';
{$IFDEF VER80}
  { Delphi 1 has a 255 characters string limitation }
  SMTP_RCV_BUF_SIZE = 255;
{$ELSE}
  SMTP_RCV_BUF_SIZE = 4096;
{$ENDIF}
  WM_SMTP_REQUEST_DONE = WM_USER + 1;

type
    SmtpException = class(Exception);
    TSmtpState    = (smtpReady,         smtpDnsLookup,       smtpConnecting,
                     smtpConnected,     smtpInternalReady,
                     smtpWaitingBanner, smtpWaitingResponse, smtpAbort);
    TSmtpRequest  = (smtpConnect, smtpHelo, smtpMailFrom, smtpVrfy,
                     smtpRcptTo,  smtpData, smtpQuit,
                     smtpRset,    smtpOpen, smtpMail, smtpCustom);
    TSmtpFct      = (smtpFctNone,       smtpFctHelo,   smtpFctConnect,
                     smtpFctMailFrom,   smtpFctRcptTo, smtpFctData,
                     smtpFctVrfy,       smtpFctQuit,   smtpFctRset);
    TSmtpFctSet   = set of TSmtpFct;
    TSmtpContentType = (smtpHTML, smtpPlainText);

    TSmtpDisplay               = procedure(Sender  : TObject;
                                           Msg     : String) of object;
    TSmtpHeaderLineEvent       = procedure(Sender  : TObject;
                                           Msg     : PChar;
                                           Size    : Integer) of object;
    TSmtpProcessHeaderEvent    = procedure(Sender  : TObject;
                                           HdrLines  : TStrings) of object;
    TSmtpGetDataEvent          = procedure(Sender  : TObject;
                                           LineNum : Integer;
                                           MsgLine : PChar;
                                           MaxLen  : Integer;
                                           var More: Boolean) of object;
    TSmtpRequestDone           = procedure(Sender  : TObject;
                                           RqType    : TSmtpRequest;
                                           Error     : Word) of object;
    TSmtpAttachmentContentType = procedure(Sender          : TObject;
                                           FileNumber      : Integer;
                                           var FileName    : String;
                                           var ContentType : String) of object;
    TSmtpAttachHeader          = procedure(Sender          : TObject;
                                           FileNumber      : Integer;
                                           FileName        : String;
                                           HdrLines        : TStrings) of object;
    TSmtpNextProc              = procedure of object;

    { Base component, implementing the transport, without MIME support }
    TCustomSmtpClient = class(TComponent)
    protected
        FWSocket             : TWSocket;     { Underlaying socket          }
        FHost                : String;       { SMTP server hostname or IP  }
        FPort                : String;       { Should be 'smtp'            }
        FSignOn              : String;       { Used for the 'HELO' command }
        FFromName            : String;       { Sender's EMail              }
        FRcptName            : TStrings;     { Recepients EMails list      }
	FMailMessage	     : TStrings;
        FHdrFrom             : String;
        FHdrTo               : String;
        FHdrReplyTo          : String;
        FHdrReturnPath       : String;
        FHdrSubject          : String;
        FHdrSender           : String;       { Mail Sender's Email         }
        FState               : TSmtpState;
        FCharSet             : String;
        FContentType         : TSmtpContentType;
        FContentTypeStr      : String;
        FLastResponse        : String;
        FErrorMessage        : String;
        FTag                 : LongInt;
        FConnected           : Boolean;
        FRequestType         : TSmtpRequest;
        FRequestDoneFlag     : Boolean;
        FReceiveLen          : Integer;
        FRequestResult       : Integer;
        FStatusCode          : Integer;
        FReceiveBuffer       : array [0..SMTP_RCV_BUF_SIZE - 1] of char;
        FNext                : TSmtpNextProc;
        FWhenConnected       : TSmtpNextProc;
        FFctSet              : TSmtpFctSet;
        FFctPrv              : TSmtpFct;
        FHighLevelResult     : Integer;
        FHighLevelFlag       : Boolean;
        FNextRequest         : TSmtpNextProc;
        FLastResponseSave    : String;
        FStatusCodeSave      : Integer;
        FRestartFlag         : Boolean;
        FOkResponses         : array [0..15] of Integer;
        FDoneAsync           : TSmtpNextProc;
        FWindowHandle        : HWND;
        FItemCount           : LongInt;
        FHdrLines            : TStrings;
        FLineNum             : Integer;
        FMoreLines           : Boolean;

        FOnDisplay           : TSmtpDisplay;
        FOnCommand           : TSmtpDisplay;
        FOnResponse          : TSmtpDisplay;
        FOnGetData           : TSmtpGetDataEvent;
        FOnHeaderLine        : TSmtpHeaderLineEvent;
        FOnProcessHeader     : TSmtpProcessHeaderEvent;
        FOnRequestDone       : TSmtpRequestDone;
        FOnStateChange       : TNotifyEvent;
        FOnSessionConnected  : TSessionConnected;
        FOnSessionClosed     : TSessionClosed;
        procedure   TriggerDisplay(Msg : String); virtual;
        procedure   TriggerCommand(Msg : String); virtual;
        procedure   TriggerResponse(Msg : String); virtual;
        procedure   TriggerRequestDone(Error: Word); virtual;
        procedure   TriggerStateChange; virtual;
        procedure   TriggerGetData(LineNum  : Integer;
                                   MsgLine  : PChar;
                                   MaxLen   : Integer;
                                   var More : Boolean); virtual;
        procedure   TriggerHeaderLine(Line : PChar; Size : Integer); virtual;
        procedure   TriggerProcessHeader(HdrLines : TStrings); virtual;
        procedure   TriggerSessionConnected(Error : Word); virtual;
        procedure   TriggerSessionClosed(Error : Word); virtual;
        procedure   ClearErrorMessage;
        procedure   SetErrorMessage;
        procedure   StateChange(NewState : TSmtpState);
        procedure   SendCommand(Cmd : String); virtual;
        procedure   SetRcptName(newValue : TStrings);
	procedure   SetMailMessage(newValue : TStrings);
        procedure   InitUUEncode(var hFile: File; sFile: string); virtual;
        procedure   DoUUEncode(var hFile: File; var sLine: string; var More: boolean); virtual;
        procedure   EndUUEncode(var hFile: File); virtual;
        procedure   CheckReady;
        procedure   WSocketDnsLookupDone(Sender: TObject; Error: Word);
        procedure   WSocketSessionConnected(Sender: TObject; Error: Word);
        procedure   WSocketDataAvailable(Sender: TObject; Error: Word);
        procedure   WSocketDataSent(Sender : TObject; Error : Word);
        procedure   WSocketSessionClosed(Sender : TObject; Error : WORD);
        procedure   DisplayLastResponse;
        procedure   DoHighLevelAsync;
        procedure   ExecAsync(RqType      : TSmtpRequest;
                              Cmd         : String;
                              OkResponses : array of Word;
                              DoneAsync   : TSmtpNextProc);
        procedure   NextExecAsync;
        procedure   RcptToNext;
        procedure   RcptToDone;
        procedure   DataNext;
        procedure   WndProc(var MsgRec: TMessage); virtual;
        procedure   WMSmtpRequestDone(var msg: TMessage);
                        message WM_SMTP_REQUEST_DONE;
    public
        constructor Create(AOwner : TComponent); override;
        destructor  Destroy;                     override;
        procedure   Connect;  virtual;    { Connect to the mail server }
        procedure   Helo;     virtual;    { Send the HELO command      }
        procedure   Vrfy;     virtual;    { Send the VRFY command      }
        procedure   MailFrom; virtual;    { Send the MAILFROM command  }
        procedure   RcptTo;   virtual;    { Send RECPTTO command       }
        procedure   Data;     virtual;    { Send DATA command          }
        procedure   Quit;     virtual;    { Send QUITE command, close  }
        procedure   Rset;     virtual;    { Send RSET command          }
        procedure   Abort;    virtual;    { Abort opertaion, close     }
        procedure   Open;     virtual;    { Connect, Helo              }
        procedure   Mail;     virtual;    { MailFrom, RcptTo, Data     }

        property    WSocket   : TWSocket               read  FWSocket;
        property    Handle    : HWND                   read  FWindowHandle;
        property    Connected : Boolean                read  FConnected;
        procedure   HighLevelAsync(RqType : TSmtpRequest; Fcts : TSmtpFctSet);
        procedure   SetContentType(newValue : TSmtpContentType);
    protected
        property Host : String                       read  FHost
                                                     write FHost;
        property Port : String                       read  FPort
                                                     write FPort;
        property SignOn : String                     read  FSignOn
                                                     write FSignOn;
        property FromName : String                   read  FFromName
                                                     write FFromName;
        property RcptName : TStrings                 read  FRcptName
                                                     write SetRcptName;
	property MailMessage : TStrings		     read  FMailMessage
						     write SetMailMessage;
        property HdrFrom : String                    read  FHdrFrom
                                                     write FHdrFrom;
        property HdrTo : String                      read  FHdrTo
                                                     write FHdrTo;
        property HdrReplyTo : String                 read  FHdrReplyTo
                                                     write FHdrReplyTo;
        property HdrReturnPath : String              read  FHdrReturnPath
                                                     write FHdrReturnPath;
        property HdrSubject : String                 read  FHdrSubject
                                                     write FHdrSubject;
        property HdrSender: String                   read  FHdrSender
                                                     write FHdrSender;
        property CharSet      : String               read  FCharSet
                                                     write FCharSet;
        property ContentType  : TSmtpContentType     read  FContentType
                                                     write SetContentType;
        property ErrorMessage : String               read  FErrorMessage;
        property LastResponse : String               read  FLastResponse;
        property State        : TSmtpState           read  FState;
        property Tag          : LongInt              read  FTag
                                                     write FTag;

        property OnDisplay : TSmtpDisplay            read  FOnDisplay
                                                     write FOnDisplay;
        property OnCommand: TSmtpDisplay             read  FOnCommand
                                                     write FOnCommand;
        property OnResponse: TSmtpDisplay            read  FOnResponse

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
青草av.久久免费一区| 亚洲综合免费观看高清完整版 | 美女看a上一区| 亚洲国产日韩一级| 夜夜精品视频一区二区| 亚洲一区二区三区自拍| 亚洲综合视频网| 亚洲成人免费观看| 日欧美一区二区| 日本中文字幕一区| 国产激情视频一区二区三区欧美| 韩国一区二区三区| 成人av午夜影院| 91色乱码一区二区三区| 欧美日韩亚洲综合一区二区三区| 欧美日韩一级片在线观看| 欧美电影一区二区| 久久综合狠狠综合久久激情| 国产偷国产偷精品高清尤物| 国产精品盗摄一区二区三区| 一区二区三区欧美| 精品一区二区三区视频在线观看| 国产精一品亚洲二区在线视频| 高清不卡在线观看| 欧美伦理电影网| 精品国偷自产国产一区| 国产精品免费视频一区| 一区二区三区在线视频观看| 日韩av电影免费观看高清完整版 | 国产精品99精品久久免费| 91免费版pro下载短视频| 在线不卡中文字幕| 欧美国产国产综合| 午夜视频一区在线观看| 国产很黄免费观看久久| 欧美午夜精品一区| 中文字幕精品—区二区四季| 亚洲va国产天堂va久久en| 精品一区二区三区视频| 色综合天天综合网国产成人综合天| 欧美电视剧免费观看| 国产精品欧美综合在线| 午夜欧美视频在线观看| 成人精品国产福利| 久久综合国产精品| 五月天亚洲精品| www.成人网.com| 日韩女优毛片在线| 天天综合天天做天天综合| 国产电影精品久久禁18| 欧美精品日韩一区| 亚洲精品日韩一| 成人性生交大片| 欧美大片一区二区三区| 亚洲成人动漫在线免费观看| 91浏览器入口在线观看| 国产精品污污网站在线观看| 精品综合久久久久久8888| 欧美日韩视频第一区| 亚洲嫩草精品久久| 成人福利在线看| 欧美国产综合一区二区| 国产一区二三区| 精品国产乱码久久久久久免费 | 欧美日韩一区中文字幕| 中文字幕亚洲一区二区va在线| 国产一区二区成人久久免费影院| 91精品国产综合久久久久| 午夜精品一区在线观看| 欧美视频在线一区二区三区 | 制服丝袜av成人在线看| 亚洲高清免费一级二级三级| 日本韩国视频一区二区| 一区二区三区四区在线播放| 91久久精品一区二区二区| 樱花草国产18久久久久| 色偷偷久久一区二区三区| 亚洲少妇中出一区| 欧美无砖专区一中文字| 亚洲午夜av在线| 日韩一级在线观看| 国产一区二区成人久久免费影院 | 美女性感视频久久| 在线成人免费观看| 国产做a爰片久久毛片| 久久久精品免费网站| 成人app下载| 亚洲一区二区视频| 日韩午夜在线观看| 韩国精品一区二区| 中文字幕视频一区| 欧美视频三区在线播放| 麻豆成人在线观看| 国产精品久久久爽爽爽麻豆色哟哟| 97se狠狠狠综合亚洲狠狠| 一区二区三区四区av| 91精品国产色综合久久不卡蜜臀 | 成人黄页毛片网站| 一区二区三区资源| 日韩一区二区电影网| 国产成人激情av| 午夜精品一区在线观看| 久久老女人爱爱| 欧美在线短视频| 国产麻豆日韩欧美久久| 亚洲精品一二三四区| 欧美一区二区美女| 不卡av在线免费观看| 亚洲h在线观看| 国产欧美综合在线观看第十页| 色www精品视频在线观看| 日本vs亚洲vs韩国一区三区| 国产精品丝袜一区| 日韩欧美激情在线| 91麻豆国产在线观看| 麻豆精品一区二区三区| 亚洲视频一区二区免费在线观看| 91精品国产综合久久久久久久| www.日本不卡| 狠狠色丁香久久婷婷综合_中| 亚洲乱码国产乱码精品精的特点| 日韩欧美国产电影| 欧美综合欧美视频| 91污在线观看| 高清久久久久久| 久久精品99国产精品日本| 亚洲影视在线播放| 专区另类欧美日韩| 国产欧美日韩另类一区| 日韩午夜av一区| 欧美三级一区二区| 91影视在线播放| 国产1区2区3区精品美女| 日韩av二区在线播放| 亚洲综合一二三区| 亚洲日本一区二区| 中文字幕av免费专区久久| 久久久综合视频| 亚洲电影一级黄| 亚洲黄色片在线观看| 国产精品久久久久久久久动漫| 日韩区在线观看| 琪琪一区二区三区| 欧美aaaaa成人免费观看视频| 国产精品一品视频| 欧美性生活久久| 久久九九全国免费| 亚洲精品美国一| 久久国产精品99久久人人澡| 成人一区二区三区视频在线观看 | www.一区二区| 欧美一区二区三区视频免费播放| 国产日韩欧美高清在线| 亚洲与欧洲av电影| 国产精品一二三在| 在线播放/欧美激情| 国产精品久久久久影院| 日本va欧美va瓶| 一本色道综合亚洲| 久久久久久久性| 日精品一区二区三区| 91在线观看污| 国产日韩成人精品| 日韩国产欧美在线视频| proumb性欧美在线观看| 日韩精品一区二区三区四区| 一区二区在线电影| 成人av片在线观看| 久久伊99综合婷婷久久伊| 伊人性伊人情综合网| 国产成人日日夜夜| 日韩欧美在线一区二区三区| 亚洲激情中文1区| 成人黄色小视频在线观看| 日韩情涩欧美日韩视频| 亚洲第一电影网| 91一区二区在线观看| 欧美国产精品v| 国产一区二区三区国产| 91精品国产色综合久久久蜜香臀| 亚洲自拍与偷拍| 91丨国产丨九色丨pron| 国产欧美视频一区二区三区| 美国一区二区三区在线播放| 欧美日韩精品免费| 亚洲国产一二三| 在线免费观看日本欧美| 亚洲三级视频在线观看| 丁香桃色午夜亚洲一区二区三区| 日韩美一区二区三区| 日韩黄色小视频| 日韩无一区二区| 另类小说色综合网站| 91超碰这里只有精品国产| 亚洲已满18点击进入久久| 欧美在线观看18| 日韩黄色一级片| 欧美草草影院在线视频| 精品一二三四区| 国产亚洲一区二区三区在线观看 |