C# Class Joshi.Utils.Imap.Imap

Imap class implementes IMAP client API
Inheritance: ImapBase
Afficher le fichier Open project: rohitjoshi/ImapLibrary Class Usage Examples

Méthodes publiques

Méthode Description
CopyMessage ( string sUid, string sFolderName ) : void

Copy Message

ExamineFolder ( string sFolder ) : void

Examine the sFolder/mailbox after login

Expunge ( ) : void

Expunge

FetchMessage ( string sMessageUID, XmlTextWriter oXmlWriter, bool bFetchBody ) : void

Fetch the full message

FetchPartBody ( string sMessageUID, string sMessagePart, string &sData ) : void

Fetch the body for specified part

FetchPartHeader ( string sMessageUID, string sMessagePart, ArrayList asMessageHeader ) : void

Fetch Header of the message uid and part

GetMessageSize ( string sUid ) : long

Get the message size

GetQuota ( string sFolderName, bool &bUnlimitedQuota, int &nUsedKBytes, int &nTotalKBytes ) : void

Get the quota for specific folder

HasEnoughQuota ( string sFolderName ) : bool

Check if enough quota is available

IsMultipart ( ArrayList asHeader ) : bool

Check if this message is multipart To Identify multipart message, the content-type is either multipart or rfc822

LogOut ( ) : void

Logout the user: It logout the user and disconnect the connetion from IMAP server.

Login ( string sHost, string sUserId, string sPassword ) : void

Login to specified Imap host and default port (143)

Login ( string sHost, ushort nPort, string sUserId, string sPassword, bool sslEnabled = false ) : void

Login to specified Imap host and port

MoveMessage ( string sUid, string sFolderName ) : void

Move message to specified folder

SearchMessage ( string asSearchData, bool bExactMatch, ArrayList asSearchResult ) : void

Search the messages by specified criterias

SelectFolder ( string sFolder ) : void

Select the sFolder/mailbox after login

SetFlag ( string sUid, string flag, bool removeFlag = false ) : void

Store flag

Private Methods

Méthode Description
FindAndRemove ( string &sBodyStruct, char ch ) : bool

find the given character and remove

GetBody ( string sMessageUid, string sPartNumber, string &sData ) : void

Get the message body for specified part

GetBodyStructure ( string sMessageUID, XmlTextWriter oXmlWriter, bool bFetchBody ) : void

Get the Body structure of the message. If message is single part then first part is 1 If message is multipart then first part is 0

GetContentDisposition ( string &sBodyStruct, string &sDisp ) : bool

Get Content Disposition

GetContentType ( string &sBodyStruct, string &sType, string &sSubType, string &sContentType ) : bool

Get the content type

GetHeader ( string sMessageUid, string sPartNumber, ArrayList asMessageHeader ) : void

Get the header for specific partNumber and Message UID

GetResponseSize ( string sResponse ) : long

Get the Size of the fetch command response response will look like "{}"

IsNilString ( string &sBodyStruct ) : bool

Returns true if starts with NIL

ParseAddress ( string &sBodyStruct, string &sString ) : bool

Parse one address and format the string

ParseAddressList ( string &sBodyStruct, string &sString ) : bool

Parse the address string

ParseBodyStructure ( string sMessageUID, string &sBodyStruct, XmlTextWriter oXmlBodyPart, string sPartPrefix, bool bFetchBody ) : bool

Parse the bodystructure and store as XML Element

ParseEnvelope ( string &sBodyStruct, ArrayList asAttrs ) : bool
ParseExtension ( string &sBodyStruct, string &sString ) : bool

Parse the extension in body structure

ParseLanguage ( string &sBodyStruct, string &sString ) : bool

Parse the language or list of languages in body structure

ParseParameters ( string &sBodyStruct, ArrayList asParams ) : bool

Parse the parameter in body structure

ParseQuotedString ( string &sBodyStruct, string &sString ) : bool

Parse the quoted string in body structure

ParseString ( string &sBodyStruct, string &sString ) : bool

Parse the string (seperated by spaces or parenthesis)

Restore ( bool bSelectFolder ) : void

Restore the connection using available old data Select the sFolder if previously selected

Method Details

CopyMessage() public méthode

Copy Message
public CopyMessage ( string sUid, string sFolderName ) : void
sUid string Either UID or range of uid e.g 1:2
sFolderName string Folder where it needs to be copied
Résultat void

ExamineFolder() public méthode

Examine the sFolder/mailbox after login
public ExamineFolder ( string sFolder ) : void
sFolder string Mailbox folder
Résultat void

Expunge() public méthode

Expunge
public Expunge ( ) : void
Résultat void

FetchMessage() public méthode

Fetch the full message
public FetchMessage ( string sMessageUID, XmlTextWriter oXmlWriter, bool bFetchBody ) : void
sMessageUID string Message UID
oXmlWriter System.Xml.XmlTextWriter
bFetchBody bool
Résultat void

FetchPartBody() public méthode

Fetch the body for specified part
public FetchPartBody ( string sMessageUID, string sMessagePart, string &sData ) : void
sMessageUID string Message uid
sMessagePart string Message part
sData string
Résultat void

FetchPartHeader() public méthode

Fetch Header of the message uid and part
public FetchPartHeader ( string sMessageUID, string sMessagePart, ArrayList asMessageHeader ) : void
sMessageUID string Message UID
sMessagePart string Message part
asMessageHeader System.Collections.ArrayList Output Array
Résultat void

GetMessageSize() public méthode

Get the message size
public GetMessageSize ( string sUid ) : long
sUid string
Résultat long

GetQuota() public méthode

Get the quota for specific folder
public GetQuota ( string sFolderName, bool &bUnlimitedQuota, int &nUsedKBytes, int &nTotalKBytes ) : void
sFolderName string Mailbox folder
bUnlimitedQuota bool Is unlimited quota
nUsedKBytes int Used quota in Kbytes
nTotalKBytes int Total quota in KBytes
Résultat void

HasEnoughQuota() public méthode

Check if enough quota is available
public HasEnoughQuota ( string sFolderName ) : bool
sFolderName string Mailbox folder
Résultat bool

IsMultipart() public méthode

Check if this message is multipart To Identify multipart message, the content-type is either multipart or rfc822
public IsMultipart ( ArrayList asHeader ) : bool
asHeader System.Collections.ArrayList
Résultat bool

LogOut() public méthode

Logout the user: It logout the user and disconnect the connetion from IMAP server.
public LogOut ( ) : void
Résultat void

Login() public méthode

Login to specified Imap host and default port (143)
public Login ( string sHost, string sUserId, string sPassword ) : void
sHost string Imap Server name
sUserId string User's login id
sPassword string User's password
Résultat void

Login() public méthode

Login to specified Imap host and port
public Login ( string sHost, ushort nPort, string sUserId, string sPassword, bool sslEnabled = false ) : void
sHost string Imap server name
nPort ushort Imap server port
sUserId string User's login id
sPassword string User's password
sslEnabled bool
Résultat void

MoveMessage() public méthode

Move message to specified folder
public MoveMessage ( string sUid, string sFolderName ) : void
sUid string UID of the message
sFolderName string Folder where you want to move the message
Résultat void

SearchMessage() public méthode

Search the messages by specified criterias
public SearchMessage ( string asSearchData, bool bExactMatch, ArrayList asSearchResult ) : void
asSearchData string Search criterias
bExactMatch bool Is it exact search
asSearchResult System.Collections.ArrayList search result
Résultat void

SelectFolder() public méthode

Select the sFolder/mailbox after login
public SelectFolder ( string sFolder ) : void
sFolder string mailbox folder
Résultat void

SetFlag() public méthode

Store flag
public SetFlag ( string sUid, string flag, bool removeFlag = false ) : void
sUid string
flag string E.g \Deleted
removeFlag bool Remove the flaf
Résultat void