Class TSMTPSend

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TSMTPSend = class(TSynaClient)

Description

Implementation of SMTP and ESMTP procotol

, include some ESMTP extensions, include SSL/TLS too.

Note: Are you missing properties for setting Username and Password for ESMTP? Look to parent TSynaClient object!

Are you missing properties for specify server address and port? Look to parent TSynaClient too!

Hierarchy

Overview

Methods

Public constructor Create;
Public destructor Destroy; override;
Public function Login: Boolean;
Public function Logout: Boolean;
Public function Reset: Boolean;
Public function NoOp: Boolean;
Public function MailFrom(const Value: string; Size: Integer): Boolean;
Public function MailTo(const Value: string): Boolean;
Public function MailData(const Value: Tstrings): Boolean;
Public function Etrn(const Value: string): Boolean;
Public function Verify(const Value: string): Boolean;
Public function StartTLS: Boolean;
Public function EnhCodeString: string;
Public function FindCap(const Value: string): string;

Properties

Published property ResultCode: Integer read FResultCode;
Published property ResultString: string read FResultString;
Published property FullResult: TStringList read FFullResult;
Published property ESMTPcap: TStringList read FESMTPcap;
Published property ESMTP: Boolean read FESMTP;
Published property AuthDone: Boolean read FAuthDone;
Published property ESMTPSize: Boolean read FESMTPSize;
Published property MaxSize: Integer read FMaxSize;
Published property EnhCode1: Integer read FEnhCode1;
Published property EnhCode2: Integer read FEnhCode2;
Published property EnhCode3: Integer read FEnhCode3;
Published property SystemName: string read FSystemName Write FSystemName;
Published property AutoTLS: Boolean read FAutoTLS Write FAutoTLS;
Published property FullSSL: Boolean read FFullSSL Write FFullSSL;
Published property Sock: TTCPBlockSocket read FSock;

Description

Methods

Public constructor Create;
 
Public destructor Destroy; override;
 
Public function Login: Boolean;

Connects to SMTP server (defined in TSynaClient.TargetHost) and begin SMTP session. (First try ESMTP EHLO, next old HELO handshake). Parses ESMTP capabilites and if you specified Username and password and remote server can handle AUTH command, try login by AUTH command. Preffered login method is CRAM-MD5 (if safer!). If all OK, result is True, else result is False.

Public function Logout: Boolean;

Close SMTP session (QUIT command) and disconnect from SMTP server.

Public function Reset: Boolean;

Send RSET SMTP command for reset SMTP session. If all OK, result is True, else result is False.

Public function NoOp: Boolean;

Send NOOP SMTP command for keep SMTP session. If all OK, result is True, else result is False.

Public function MailFrom(const Value: string; Size: Integer): Boolean;

Send MAIL FROM SMTP command for set sender e-mail address. If sender's e-mail address is empty string, transmited message is error message.

If size not 0 and remote server can handle SIZE parameter, append SIZE parameter to request. If all OK, result is True, else result is False.

Public function MailTo(const Value: string): Boolean;

Send RCPT TO SMTP command for set receiver e-mail address. It cannot be an empty string. If all OK, result is True, else result is False.

Public function MailData(const Value: Tstrings): Boolean;

Send DATA SMTP command and transmit message data. If all OK, result is True, else result is False.

Public function Etrn(const Value: string): Boolean;

Send ETRN SMTP command for start sending of remote queue for domain in Value. If all OK, result is True, else result is False.

Public function Verify(const Value: string): Boolean;

Send VRFY SMTP command for check receiver e-mail address. It cannot be an empty string. If all OK, result is True, else result is False.

Public function StartTLS: Boolean;

Call STARTTLS command for upgrade connection to SSL/TLS mode.

Public function EnhCodeString: string;

Return string descriptive text for enhanced result codes stored in EnhCode1, EnhCode2 and EnhCode3.

Public function FindCap(const Value: string): string;

Try to find specified capability in ESMTP response.

Properties

Published property ResultCode: Integer read FResultCode;

result code of last SMTP command.

Published property ResultString: string read FResultString;

result string of last SMTP command (begin with string representation of result code).

Published property FullResult: TStringList read FFullResult;

All result strings of last SMTP command (result is maybe multiline!).

Published property ESMTPcap: TStringList read FESMTPcap;

List of ESMTP capabilites of remote ESMTP server. (If you connect to ESMTP server only!).

Published property ESMTP: Boolean read FESMTP;

True if you successfuly logged to ESMTP server.

Published property AuthDone: Boolean read FAuthDone;

True if you successfuly pass authorisation to remote server.

Published property ESMTPSize: Boolean read FESMTPSize;

True if remote server can handle SIZE parameter.

Published property MaxSize: Integer read FMaxSize;

When ESMTPSize is True, contains max length of message that remote server can handle.

Published property EnhCode1: Integer read FEnhCode1;

First digit of Enhanced result code. If last operation does not have enhanced result code, values is 0.

Published property EnhCode2: Integer read FEnhCode2;

Second digit of Enhanced result code. If last operation does not have enhanced result code, values is 0.

Published property EnhCode3: Integer read FEnhCode3;

Third digit of Enhanced result code. If last operation does not have enhanced result code, values is 0.

Published property SystemName: string read FSystemName Write FSystemName;

name of our system used in HELO and EHLO command. Implicit value is internet address of your machine.

Published property AutoTLS: Boolean read FAutoTLS Write FAutoTLS;

If is set to true, then upgrade to SSL/TLS mode if remote server support it.

Published property FullSSL: Boolean read FFullSSL Write FFullSSL;

SSL/TLS mode is used from first contact to server. Servers with full SSL/TLS mode usualy using non-standard TCP port!

Published property Sock: TTCPBlockSocket read FSock;

Socket object used for TCP/IP operation. Good for seting OnStatus hook, etc.


Generated by PasDoc 0.9.0 on 2012-04-23 21:38:51