# 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

TIMAPSend > TSynaClient > TObject

## Methods

### Overview

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

### Description

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

Add flags to message's flags.

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

Append given message to specified folder.

| `function Capability: Boolean;`

Call CAPABILITY command and fill IMAPcap property by new values.

| `function CheckFolder: Boolean;`

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

| `function CloseFolder: Boolean;`

Close a folder. (end of Selected state)

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

Copy message from current selected folder to another folder.

| `constructor Create;`

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

Create a new folder.

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

Delete a folder.

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

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

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

Remove flags from message's flags.

| `destructor Destroy; override;`

| `function ExpungeFolder: Boolean;`

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

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

Get message headers only from specified message in selected folder.

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

Get full message from specified message in selected folder.

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

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

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

Gets flags of message from current selected folder.

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

return UID of requested message ID.

| `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 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 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 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 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 MessageSize(MessID: integer): integer;`

Return message size of specified message from current selected folder.

| `function NoOp: Boolean;`

Do NOOP. It is for prevent disconnect by timeout.

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

Rename folder names.

| `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 SelectFolder(FolderName: string): Boolean;`

Select folder.

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

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

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

Sets flags of message from current selected folder.

| `function StartTLS: Boolean;`

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

| `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 SubscribeFolder(FolderName: string): Boolean;`

Subscribe folder.

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

Unsubscribe folder.

## Properties

### Overview

| `property AuthDone: Boolean;`
| `property AutoTLS: Boolean;`
| `property FullResult: TStringList;`
| `property FullSSL: Boolean;`
| `property IMAPcap: TStringList;`
| `property ResultString: string;`
| `property SelectedCount: integer;`
| `property SelectedFolder: string;`
| `property SelectedRecent: integer;`
| `property SelectedUIDvalidity: integer;`
| `property Sock: TTCPBlockSocket;`
| `property UID: Boolean;`

### Description

| `property AuthDone: Boolean;`

Authorization is successful done.

| `property AutoTLS: Boolean;`

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

| `property FullResult: TStringList;`

Full result of last IMAP operation.

| `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 IMAPcap: TStringList;`

List of server capabilites.

| `property ResultString: string;`

Status line with result of last operation.

| `property SelectedCount: integer;`

Count of messages in currently selected folder.

| `property SelectedFolder: string;`

Name of currently selected folder.

| `property SelectedRecent: integer;`

Count of not-visited messages in currently selected folder.

| `property SelectedUIDvalidity: integer;`

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 Sock: TTCPBlockSocket;`

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

| `property UID: Boolean;`

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

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