Skip to content
Dmitry Boyarintsev edited this page Nov 14, 2021 · 10 revisions

IMailClient is the based email client interface used to Get and Delete messages. Both Pop3Client and ImapClient implement the interface. The most common and basic functionality is implemented by the interface, for the tasks supported by a particular email client protocol you need to use the actual protocol class.

Namespace: AE.Net.Mail

Table of Contents

Public API

EventHandler Warning

DeleteMessage

Disconnect

GetMessage

Returns a single MailMessage class by either (zero-based) index. (Index should not be greater or equal to the number returned by GetMessageCount)

 MailMessage GetMessage(int index, bool headersonly = false);

or by message ID.

 MailMessage GetMessage(string uid, bool headersonly = false);
  • headersonly parameter returns only the header information and doesn't attempt to download the body or body parts (attachments) of the email.
For more sophisticated access (i.e. retrieving messages in a batch, use the actual protocol implementation class)

if headersonly is specified to true, the following properties of MailMessage will not be populated:

  • Body
  • Attachments
  • AlternateViews
ImapClient. The message received is automatically marked as "seen" on the server side. (for control of this behavior you need to refer to the underlying mail class implementation).

GetMessageCount

Returns the number of the of available messages from the default (current/selected) mail box (directory/folder). ImapClient class provides an additional method with the ability to specify the exact mail box desired.

Clone this wiki locally