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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? smtpprot.pas

?? 包含常用Internet協議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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产乱子伦一区| 99精品黄色片免费大全| 欧美一区二区三区电影| 日韩成人伦理电影在线观看| 欧美一区二区性放荡片| 久久99精品久久久久久动态图| 欧美v日韩v国产v| 国产**成人网毛片九色| 一色屋精品亚洲香蕉网站| 日本电影亚洲天堂一区| 五月激情综合色| 成人黄色在线看| 99re热视频这里只精品| 亚洲成人一区二区在线观看| 日日嗨av一区二区三区四区| 蜜乳av一区二区三区| 日韩欧美在线网站| 久久国产精品色| 中文字幕高清不卡| 欧美性感一区二区三区| 久久99国内精品| 国产精品久久久一区麻豆最新章节| 91一区二区在线| 美女mm1313爽爽久久久蜜臀| 国产精品系列在线| 欧美日韩大陆在线| 国产精品综合二区| 亚洲国产成人porn| 国产午夜精品一区二区| 欧美视频在线播放| 成人精品在线视频观看| 日韩有码一区二区三区| 国产精品国产三级国产普通话99 | 一区二区国产视频| 日韩你懂的在线播放| 99久久综合狠狠综合久久| 午夜精品久久久久影视| 国产精品私人影院| 日韩欧美国产wwwww| 91在线视频免费观看| 激情小说亚洲一区| 午夜久久久影院| 成人免费一区二区三区视频| 日韩欧美第一区| 欧美亚洲另类激情小说| 成人ar影院免费观看视频| 蜜臀久久99精品久久久画质超高清| 国产精品久久毛片a| 精品福利一二区| 欧美日韩国产高清一区二区三区 | 国产午夜亚洲精品不卡| 欧美精品成人一区二区三区四区| 东方aⅴ免费观看久久av| 免费在线成人网| 亚洲第四色夜色| 一区二区三区蜜桃网| 亚洲欧美怡红院| 久久九九全国免费| 欧美mv日韩mv亚洲| 9191国产精品| 欧美三级午夜理伦三级中视频| 成人av在线资源| 成人中文字幕合集| 国产一区二区视频在线播放| 奇米一区二区三区av| 亚洲福利一二三区| 亚洲综合av网| 亚洲精品中文字幕在线观看| 国产精品伦一区| 久久精品男人天堂av| 亚洲精品一区二区三区香蕉| 这里只有精品电影| 在线不卡一区二区| 欧美日韩不卡一区二区| 欧美日韩一区二区三区四区五区| 91猫先生在线| 91丨九色丨黑人外教| 成人精品鲁一区一区二区| 国产呦萝稀缺另类资源| 国产精品 日产精品 欧美精品| 韩国v欧美v亚洲v日本v| 国产精品一区在线观看你懂的| 国产.欧美.日韩| av资源站一区| 91麻豆福利精品推荐| 在线视频欧美精品| 欧美日韩在线播放三区| 91精品国产91久久综合桃花| 日韩一区二区在线免费观看| 欧美精品一区二区蜜臀亚洲| 久久久不卡网国产精品二区| 国产人妖乱国产精品人妖| 中文字幕亚洲一区二区av在线| 成人免费一区二区三区视频| 亚洲一卡二卡三卡四卡 | 国产精品久久夜| 亚洲欧美偷拍卡通变态| 亚洲自拍偷拍欧美| 久久精品理论片| 国产不卡视频一区| 日本韩国欧美国产| 日韩一区二区中文字幕| 亚洲国产精品av| 一片黄亚洲嫩模| 精品一区二区成人精品| 波多野结衣亚洲一区| 欧美视频精品在线观看| 精品91自产拍在线观看一区| 国产免费观看久久| 亚洲午夜激情av| 久久99精品久久久久婷婷| 99精品视频在线播放观看| 欧美日韩一区二区在线视频| 精品盗摄一区二区三区| 亚洲欧美成人一区二区三区| 日韩av一区二区三区四区| 国产成人免费在线观看不卡| 在线一区二区三区做爰视频网站| 欧美一区二区三区人| 中文字幕视频一区| 蜜桃视频在线观看一区二区| 91亚洲男人天堂| 欧美变态tickle挠乳网站| 亚洲免费观看高清完整版在线 | 国产精品久久久久9999吃药| 视频在线在亚洲| 91啪在线观看| 久久品道一品道久久精品| 亚洲永久免费视频| 成人性生交大片免费看在线播放| 欧美片网站yy| 亚洲三级免费电影| 国产一区二区视频在线播放| 欧美日韩一区二区在线视频| 国产精品嫩草久久久久| 美国一区二区三区在线播放| 色欧美乱欧美15图片| 日本一区二区三区视频视频| 日韩av一二三| 欧美日韩在线播放三区四区| 国产精品沙发午睡系列990531| 日本伊人色综合网| 色菇凉天天综合网| 国产精品麻豆视频| 福利电影一区二区| 久久久精品免费网站| 秋霞影院一区二区| 欧美日本国产视频| 亚洲午夜免费电影| 成人激情开心网| 久久久久久免费网| 精品中文av资源站在线观看| 欧美裸体一区二区三区| 亚洲综合丝袜美腿| 色哟哟一区二区三区| 亚洲欧洲av另类| 成人avav影音| 国产精品福利一区| va亚洲va日韩不卡在线观看| 久久女同互慰一区二区三区| 激情久久五月天| 精品国产成人系列| 久久99精品国产麻豆婷婷| 国产精品久久久久久久久久免费看 | 亚洲一区在线看| 日本丶国产丶欧美色综合| 国产精品免费视频网站| 丰满岳乱妇一区二区三区| 国产网站一区二区| 国产suv精品一区二区三区| 国产视频一区二区在线观看| 国产精品一区二区黑丝| 久久久久久亚洲综合| 国产成人在线视频播放| 国产精品少妇自拍| 色婷婷精品久久二区二区蜜臂av | 国产精品每日更新在线播放网址| 丰满亚洲少妇av| 亚洲欧美一区二区三区国产精品| 一本色道**综合亚洲精品蜜桃冫| 亚洲日穴在线视频| 欧美亚一区二区| 蜜桃一区二区三区四区| 久久理论电影网| 国产成人精品亚洲日本在线桃色| 欧美国产乱子伦| 在线观看日韩电影| 老司机精品视频线观看86| 精品粉嫩aⅴ一区二区三区四区| 国产成人综合在线| 亚洲天堂福利av| 欧美日韩中文一区| 久久99国产精品免费| 亚洲在线免费播放| 九九九精品视频| 欧美肥大bbwbbw高潮| 日韩福利电影在线| 国产日韩视频一区二区三区| 91在线观看污| 免费观看一级欧美片|