Quick Start With Email Client

Built-In Email Client

Aspose.Email Cloud API contains a built-in email client.

The built-in email client supports:

  • SMTP
  • POP3
  • IMAP
  • EWS
  • WebDav
  • Virtual multi-account

Virtual multi-account is a fast and convenient way to set up multiple email accounts and use them as a single one.

How to Work With Email Client

Before we start, we should set up an email account. This allows you to process your messages with built-in Email Client which is developed by Aspose.Email Cloud.

The created email account will be saved on storage, so you don’t have to repeat this operation later.

Setup email account

First of all, you need to set up your email account’s credentials with EmailClientAccountPasswordCredentials class. Define two fields: Login (Email client account login) and Password (Email client account password).

Then you need to initialize EmailClientAccount object. Let’s define the following parameters:

  • Host — Mail server hostname or IP address.
  • Port — Mail server port.
  • ProtocolType — Type of connection protocol. Enum, available values: IMAP, POP3, SMTP, EWS, WebDav.
  • SecurityOptions — Email account security mode Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto.
  • Credentials — Email client account credentials that we have created before.

To save your email account use SaveAsync from ClientAccountApi. You should create a request for this operation using ClientAccountSaveRequest, which has 2 parameters:

  • Value — Object we want to save on Storage.
  • StorageFile — StorageFileLocation object, which contains IMAP account’s file location information, including storage name, a path to an account folder, name of the file with IMAP account’s configurations.