# Class TSMTPSend

Description | Hierarchy | Fields | Methods | Properties

## Unit

smtpsend

## 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

TSMTPSend > TSynaClient > TObject

## Methods

### Overview

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

### Description

| `constructor Create;`

| `destructor Destroy; override;`

| `function EnhCodeString: string;`

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

| `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 FindCap(const Value: string): string;`

Try to find specified capability in ESMTP response.

| `function Login: Boolean;`

Connects to SMTP server (defined in 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 MailData(const Value: Tstrings): Boolean;`

Send DATA SMTP command and transmit message data. 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 NoOp: Boolean;`

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

| `function Reset: Boolean;`

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

| `function StartTLS: Boolean;`

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

| `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`.

## Properties

### Overview

| `property AuthDone: Boolean;`
| `property AutoTLS: Boolean;`
| `property EnhCode1: Integer;`
| `property EnhCode2: Integer;`
| `property EnhCode3: Integer;`
| `property ESMTP: Boolean;`
| `property ESMTPcap: TStringList;`
| `property ESMTPSize: Boolean;`
| `property FullResult: TStringList;`
| `property FullSSL: Boolean;`
| `property MaxSize: Integer;`
| `property ResultCode: Integer;`
| `property ResultString: string;`
| `property Sock: TTCPBlockSocket;`
| `property SystemName: string;`

### Description

| `property AuthDone: Boolean;`

`True` if you successfuly pass authorisation to remote server.

| `property AutoTLS: Boolean;`

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

| `property EnhCode1: Integer;`

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

| `property EnhCode2: Integer;`

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

| `property EnhCode3: Integer;`

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

| `property ESMTP: Boolean;`

`True` if you successfuly logged to ESMTP server.

| `property ESMTPcap: TStringList;`

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

| `property ESMTPSize: Boolean;`

`True` if remote server can handle SIZE parameter.

| `property FullResult: TStringList;`

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

| `property FullSSL: Boolean;`

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

| `property MaxSize: Integer;`

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

| `property ResultCode: Integer;`

result code of last SMTP command.

| `property ResultString: string;`

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

| `property Sock: TTCPBlockSocket;`

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

| `property SystemName: string;`

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

Generated by PasDoc 0.8.8.2 on 2005-01-19 20:01:19