# Class TIMAPSend

Description | Hierarchy | Fields | Methods | Properties

## Unit

imapsend

## Declaration

`type TIMAPSend = class(TSynaClient)`

## Description

Implementation of IMAP4 protocol.

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

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

## Hierarchy

- TObject
- TSynaClient
- TIMAPSend

## Overview

### Methods

| `constructor Create;`
| `destructor Destroy; override;`
| `function IMAPcommand(Value: string): string;`
| `function IMAPuploadCommand(Value: string; const Data:TStrings): string;`
| `function Capability: Boolean;`
| `function Login: Boolean;`
| `function Logout: Boolean;`
| `function NoOp: Boolean;`
| `function List(FromFolder: string; const FolderList: TStrings): Boolean;`
| `function ListSearch(FromFolder, Search: string; const FolderList: TStrings): Boolean;`
| `function ListSubscribed(FromFolder: string; const FolderList: TStrings): Boolean;`
| `function ListSearchSubscribed(FromFolder, Search: string; const FolderList: TStrings): Boolean;`
| `function CreateFolder(FolderName: string): Boolean;`
| `function DeleteFolder(FolderName: string): Boolean;`
| `function RenameFolder(FolderName, NewFolderName: string): Boolean;`
| `function SubscribeFolder(FolderName: string): Boolean;`
| `function UnsubscribeFolder(FolderName: string): Boolean;`
| `function SelectFolder(FolderName: string): Boolean;`
| `function SelectROFolder(FolderName: string): Boolean;`
| `function CloseFolder: Boolean;`
| `function StatusFolder(FolderName, Value: string): integer;`
| `function ExpungeFolder: Boolean;`
| `function CheckFolder: Boolean;`
| `function AppendMess(ToFolder: string; const Mess: TStrings): Boolean;`
| `function DeleteMess(MessID: integer): boolean;`
| `function FetchMess(MessID: integer; const Mess: TStrings): Boolean;`
| `function FetchHeader(MessID: integer; const Headers: TStrings): Boolean;`
| `function MessageSize(MessID: integer): integer;`
| `function CopyMess(MessID: integer; ToFolder: string): Boolean;`
| `function SearchMess(Criteria: string; const FoundMess: TStrings): Boolean;`
| `function SetFlagsMess(MessID: integer; Flags: string): Boolean;`
| `function GetFlagsMess(MessID: integer; var Flags: string): Boolean;`
| `function AddFlagsMess(MessID: integer; Flags: string): Boolean;`
| `function DelFlagsMess(MessID: integer; Flags: string): Boolean;`
| `function StartTLS: Boolean;`
| `function GetUID(MessID: integer; var UID : Integer): Boolean;`
| `function FindCap(const Value: string): string;`

### Properties

| `property ResultString: string read FResultString;`
| `property FullResult: TStringList read FFullResult;`
| `property IMAPcap: TStringList read FIMAPcap;`
| `property AuthDone: Boolean read FAuthDone;`
| `property UID: Boolean read FUID Write FUID;`
| `property SelectedFolder: string read FSelectedFolder;`
| `property SelectedCount: integer read FSelectedCount;`
| `property SelectedRecent: integer read FSelectedRecent;`
| `property SelectedUIDvalidity: integer read FSelectedUIDvalidity;`
| `property AutoTLS: Boolean read FAutoTLS Write FAutoTLS;`
| `property FullSSL: Boolean read FFullSSL Write FFullSSL;`
| `property Sock: TTCPBlockSocket read FSock;`

## Description

### Methods

| `constructor Create;`

| `destructor Destroy; override;`

| `function IMAPcommand(Value: string): string;`

By this function you can call any IMAP command. Result of this command is in adequate properties.

| `function IMAPuploadCommand(Value: string; const Data:TStrings): string;`

By this function you can call any IMAP command what need upload any data. Result of this command is in adequate properties.

| `function Capability: Boolean;`

Call CAPABILITY command and fill IMAPcap property by new values.

| `function Login: Boolean;`

Connect to IMAP server and do login to this server. This command begin session.

| `function Logout: Boolean;`

Disconnect from IMAP server and terminate session session. If exists some deleted and non-purged messages, these messages are not deleted!

| `function NoOp: Boolean;`

Do NOOP. It is for prevent disconnect by timeout.

| `function List(FromFolder: string; const FolderList: TStrings): Boolean;`

Lists folder names. You may specify level of listing. If you specify FromFolder as empty string, return is all folders in system.

| `function ListSearch(FromFolder, Search: string; const FolderList: TStrings): Boolean;`

Lists folder names what match search criteria. You may specify level of listing. If you specify FromFolder as empty string, return is all folders in system.

| `function ListSubscribed(FromFolder: string; const FolderList: TStrings): Boolean;`

Lists subscribed folder names. You may specify level of listing. If you specify FromFolder as empty string, return is all subscribed folders in system.

| `function ListSearchSubscribed(FromFolder, Search: string; const FolderList: TStrings): Boolean;`

Lists subscribed folder names what matching search criteria. You may specify level of listing. If you specify FromFolder as empty string, return is all subscribed folders in system.

| `function CreateFolder(FolderName: string): Boolean;`

Create a new folder.

| `function DeleteFolder(FolderName: string): Boolean;`

Delete a folder.

| `function RenameFolder(FolderName, NewFolderName: string): Boolean;`

Rename folder names.

| `function SubscribeFolder(FolderName: string): Boolean;`

Subscribe folder.

| `function UnsubscribeFolder(FolderName: string): Boolean;`

Unsubscribe folder.

| `function SelectFolder(FolderName: string): Boolean;`

Select folder.

| `function SelectROFolder(FolderName: string): Boolean;`

Select folder, but only for reading. Any changes are not allowed!

| `function CloseFolder: Boolean;`

Close a folder. (end of Selected state)

| `function StatusFolder(FolderName, Value: string): integer;`

Ask for given status of folder. I.e. if you specify as value 'UNSEEN', result is number of unseen messages in folder. For another status indentificator check IMAP documentation and documentation of your IMAP server (each IMAP server can have their own statuses.)

| `function ExpungeFolder: Boolean;`

Hardly delete all messages marked as 'deleted' in current selected folder.

| `function CheckFolder: Boolean;`

Touch to folder. (use as update status of folder, etc.)

| `function AppendMess(ToFolder: string; const Mess: TStrings): Boolean;`

Append given message to specified folder.

| `function DeleteMess(MessID: integer): boolean;`

'Delete' message from current selected folder. It mark message as Deleted. Real deleting will be done after sucessfull CloseFolder or ExpungeFolder

| `function FetchMess(MessID: integer; const Mess: TStrings): Boolean;`

Get full message from specified message in selected folder.

| `function FetchHeader(MessID: integer; const Headers: TStrings): Boolean;`

Get message headers only from specified message in selected folder.

| `function MessageSize(MessID: integer): integer;`

Return message size of specified message from current selected folder.

| `function CopyMess(MessID: integer; ToFolder: string): Boolean;`

Copy message from current selected folder to another folder.

| `function SearchMess(Criteria: string; const FoundMess: TStrings): Boolean;`

Return message numbers from currently selected folder as result of searching. Search criteria is very complex language (see to IMAP specification) similar to SQL (but not same syntax!).

| `function SetFlagsMess(MessID: integer; Flags: string): Boolean;`

Sets flags of message from current selected folder.

| `function GetFlagsMess(MessID: integer; var Flags: string): Boolean;`

Gets flags of message from current selected folder.

| `function AddFlagsMess(MessID: integer; Flags: string): Boolean;`

Add flags to message's flags.

| `function DelFlagsMess(MessID: integer; Flags: string): Boolean;`

Remove flags from message's flags.

| `function StartTLS: Boolean;`

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

| `function GetUID(MessID: integer; var UID : Integer): Boolean;`

return UID of requested message ID.

| `function FindCap(const Value: string): string;`

Try to find given capabily in capabilty string returned from IMAP server.

### Properties

| `property ResultString: string read FResultString;`

Status line with result of last operation.

| `property FullResult: TStringList read FFullResult;`

Full result of last IMAP operation.

| `property IMAPcap: TStringList read FIMAPcap;`

List of server capabilites.

| `property AuthDone: Boolean read FAuthDone;`

Authorization is successful done.

| `property UID: Boolean read FUID Write FUID;`

Turn on or off usage of UID (unicate identificator) of messages instead only sequence numbers.

| `property SelectedFolder: string read FSelectedFolder;`

Name of currently selected folder.

| `property SelectedCount: integer read FSelectedCount;`

Count of messages in currently selected folder.

| `property SelectedRecent: integer read FSelectedRecent;`

Count of not-visited messages in currently selected folder.

| `property SelectedUIDvalidity: integer read FSelectedUIDvalidity;`

This number with name of folder is unique indentificator of folder. (If someone delete folder and next create new folder with exactly same name of folder, this number is must be different!)

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

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