LibY!Mail  0.20
A .NET object oriented hierarchical encapsulation of the Yahoo! Mail web services.
Folder Class Reference

Describes a folder of messages in the mail account. More...

Public Member Functions

void FlagMessages (YMailMessage[] messages, MessageFlags flags, Filter filter)
 Flag messages in this folder that match filter with the specified flags .
 
UInt64 GetMessageContent (MessageRequest[] requests, String charset, UInt32 truncateAt)
 Retrieve the content of a message from the server.
 
YMailMessage ImportMessage (String content)
 Load a Base64 encoded message to the folder on the server
 
void ListMessages (SortKey sortKey, SortOrder sortOrder, Filter filter)
 Fill the YMailMessages collection with messages in this folder.
 
YMailMessage SaveMessage (MailMessage message)
 Save a new message in a folder
 

Properties

Boolean IsSystem [get]
 Gets a value indicating if this is a predefined system folder.
 
String Name [get, set]
 Gets or set the name of the folder
 
UInt64 Size [get]
 Gets the size, in bytes, of the folder.
 
UInt64 TotalCount [get]
 Gets the total number of messages in the folder.
 
UInt64 UnreadCount [get]
 Gets the number of unread messages in this folder.
 
YMailMessageCollection YMailMessages [get]
 Gets the collection of messages in this folder
 

Detailed Description

Describes a folder of messages in the mail account.

Encapsulates the Yahoo! Mail Web Services Fid and FolderData tata types.

Member Function Documentation

void FlagMessages ( YMailMessage[]  messages,
MessageFlags  flags,
Filter  filter 
)

Flag messages in this folder that match filter with the specified flags .

Parameters
messagesList of messages to flag
flagsA bitwise OR of flags to set on the messages
filterA bitwise OR of filtering terms to use on messages before the flags are set.
Exceptions
MessageErrorExceptionThere were errors setting flags for some messages.
UInt64 GetMessageContent ( MessageRequest[]  requests,
String  charset,
UInt32  truncateAt 
)

Retrieve the content of a message from the server.

Parameters
requestsAn array of MessageRequest objects for each message.
charsetThe messages character set
truncateAtNumber of bytes to begin trancation of the message
Returns
The number of messages fetched.

The requests array should be composed of MessageRequest objects returned from the YMailMessage.GetMessageRequest method of each message for which the content is to be retrieved.

YMailMessage ImportMessage ( String  content)

Load a Base64 encoded message to the folder on the server

Parameters
contentThe content of the message, including headers and attachments.
Returns
The new message

The returned message will not include the content of the message you loaded. To get the message content, call the GetMessageContent method.

You can use this method e.g. for importing messages from another email client to Yahoo! Mail, if the other client can save the message to a file you can encode.

void ListMessages ( SortKey  sortKey,
SortOrder  sortOrder,
Filter  filter 
)

Fill the YMailMessages collection with messages in this folder.

Parameters
sortKeyThe property to sort the messages by
sortOrderThe order to sort the message by, ascending or descending
filterA bitwise OR of Filter members to use as filter for the messages retrieved.

Calling this method invalidates the message collection available from the YMailMessages property, and fills it with new messages retrieved from the Yahoo! Mail server for this folder.

YMailMessage SaveMessage ( MailMessage  message)

Save a new message in a folder

Parameters
messageThe message to save
Returns
The new YMailMessage added to the folder

You can use this method e.g. for saving draft messages in the "drafts" folder.

The returned YMailMessage will not include the content of the message parameter. In order to get the message content, you should call the GetMessageContent method.

Property Documentation

Boolean IsSystem
get

Gets a value indicating if this is a predefined system folder.

true if this is a system folder, false if this is a user-defined folder.

String Name
getset

Gets or set the name of the folder

Setting a new name calls the Yahoo! Mail Web Services RenameFolder web service, so this may take a while.

Exceptions
InvalidOperationExceptionTrying to set a new name and the IsSystem property is true.
UInt64 Size
get

Gets the size, in bytes, of the folder.

The total size of all messages in the folder.

UInt64 TotalCount
get

Gets the total number of messages in the folder.

This value is returned from the ListFolders web service, and should be the same as CollectionBase.Count for the collection returned from YMailMessages.

UInt64 UnreadCount
get

Gets the number of unread messages in this folder.

YMailMessageCollection YMailMessages
get

Gets the collection of messages in this folder

On the first access to this property, the messages for this folder are retrieved from the Yahoo! Mail server, so this can take a while.


The documentation for this class was generated from the following file: