Description | Hierarchy | Fields | Methods | Properties |
type TSMTPSend = class(TSynaClient)
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!
constructor Create; |
|
destructor Destroy; override; |
|
function Login: Boolean; |
|
function Logout: Boolean; |
|
function Reset: Boolean; |
|
function NoOp: Boolean; |
|
function MailFrom(const Value: string; Size: Integer): Boolean; |
|
function MailTo(const Value: string): Boolean; |
|
function MailData(const Value: Tstrings): Boolean; |
|
function Etrn(const Value: string): Boolean; |
|
function Verify(const Value: string): Boolean; |
|
function StartTLS: Boolean; |
|
function EnhCodeString: string; |
|
function FindCap(const Value: string): string; |
property ResultCode: Integer read FResultCode; |
|
property ResultString: string read FResultString; |
|
property FullResult: TStringList read FFullResult; |
|
property ESMTPcap: TStringList read FESMTPcap; |
|
property ESMTP: Boolean read FESMTP; |
|
property AuthDone: Boolean read FAuthDone; |
|
property ESMTPSize: Boolean read FESMTPSize; |
|
property MaxSize: Integer read FMaxSize; |
|
property EnhCode1: Integer read FEnhCode1; |
|
property EnhCode2: Integer read FEnhCode2; |
|
property EnhCode3: Integer read FEnhCode3; |
|
property SystemName: string read FSystemName Write FSystemName; |
|
property AutoTLS: Boolean read FAutoTLS Write FAutoTLS; |
|
property FullSSL: Boolean read FFullSSL Write FFullSSL; |
|
property Sock: TTCPBlockSocket read FSock; |
constructor Create; |
destructor Destroy; override; |
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
.
function Logout: Boolean; |
Close SMTP session (QUIT command) and disconnect from SMTP server.
function Reset: Boolean; |
Send RSET SMTP command for reset SMTP session. If all OK, result is True
, else result is False
.
function NoOp: Boolean; |
Send NOOP SMTP command for keep SMTP session. If all OK, result is True
, else result is False
.
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
.
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
.
function MailData(const Value: Tstrings): Boolean; |
Send DATA SMTP command and transmit message data. If all OK, result is True
, else result is False
.
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
.
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
.
function StartTLS: Boolean; |
Call STARTTLS command for upgrade connection to SSL/TLS mode.
function EnhCodeString: string; |
Return string descriptive text for enhanced result codes stored in EnhCode1, EnhCode2 and EnhCode3.
function FindCap(const Value: string): string; |
Try to find specified capability in ESMTP response.
property ResultCode: Integer read FResultCode; |
result code of last SMTP command.
property ResultString: string read FResultString; |
result string of last SMTP command (begin with string representation of result code).
property FullResult: TStringList read FFullResult; |
All result strings of last SMTP command (result is maybe multiline!).
property ESMTPcap: TStringList read FESMTPcap; |
List of ESMTP capabilites of remote ESMTP server. (If you connect to ESMTP server only!).
property ESMTP: Boolean read FESMTP; |
True
if you successfuly logged to ESMTP server.
property AuthDone: Boolean read FAuthDone; |
True
if you successfuly pass authorisation to remote server.
property ESMTPSize: Boolean read FESMTPSize; |
True
if remote server can handle SIZE parameter.
property MaxSize: Integer read FMaxSize; |
When ESMTPSize is True
, contains max length of message that remote server can handle.
property EnhCode1: Integer read FEnhCode1; |
First digit of Enhanced result code. If last operation does not have enhanced result code, values is 0.
property EnhCode2: Integer read FEnhCode2; |
Second digit of Enhanced result code. If last operation does not have enhanced result code, values is 0.
property EnhCode3: Integer read FEnhCode3; |
Third digit of Enhanced result code. If last operation does not have enhanced result code, values is 0.
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.
property AutoTLS: Boolean read FAutoTLS Write FAutoTLS; |
If is set to true, then upgrade to SSL/TLS mode if remote server support it.
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!
property Sock: TTCPBlockSocket read FSock; |
Socket object used for TCP/IP operation. Good for seting OnStatus hook, etc.