Hello Guys! In today’s blog, I am going to give you walk through of many new exciting features and enhancements carried out in latest Aspose.Email 19.4. The best thing about Aspose team is that it publishes both .NET and Java based API having same features sets every month simultaneously. This way, the users of both API’s can make use of new features irrespective of application and platform type. In following sections, I will shed some light on new features available in API and how to use them.

Working with MultiConnection

The ImapClient, SmtpClient and Pop3Client provide a UseMultyConnection property which can be used to create multiple connections for heavy operations. It allows one to set the number of connections to be used during multiconnection mode by using ImapClient.ConnectionsQuantity, SmtpClient.ConnectionsQuantity and Pop3Client.ConnectionsQuantity respectively. The use of MultiConnection approach may increase the performance but it is not guaranteed. With this feature support, you can perform activities like:

  • Listing messages

  • Add multiple messages

  • Sending emails using MultiConnection

In the following example Pop3Client is being used to open multi connection and listing messages. The UseMultyConnection) property is used to create multiple connections by setting the number of connections to be used during multiconnection mode by using Pop3Client.ConnectionsQuantity).

The similar Java based example for this is:

One can add multiple messages by using the AppendMessages method provided by the ImapClient classes. The AppendMessages method accepts a list of MailMessage and adds it to the current folder if the folder is not provided as a parameter.The following example shows how to add multiple messages by using the MultiConnection mode.

The similar Java based example for this is:

In the following example, MultiConnection mode has set in SmtpClient for sending multiple messages.

The similar Java based example for this is:

Group Fetch Message

Pop3Client and ImapClient provide a FetchMessages method which accepts iterable of Sequence Numbers or Unique ID and returns a list of MailMessage. The following example demonstrates the use of the FetchMessages method to fetch messages by Sequence Numbers and Unique ID.

The similar Java based example for this is:

Connecting to Server in Read-Only mode

The ImapClient class provides a ReadOnly property which when set to true, indicates that no changes should be made to the permanent state of the mailbox. In the following example we have demonstrated the use of ImapClient.ReadOnly property. In example, it gets the count of unread messages, then fetches one message and then gets the count of unread messages again in read-only mode. The count of the unread messages remains the same indicating that the permanent state of the mailbox was not changed.

The similar Java based example for this is:

Ability to save Contact in Version 3 VCF Format

In this new version, you have ability to save contact in version 3 VCF format. In order to save the contact in version 3 VCF format, one need to use the VCardVersion enumerable to set the VCardSaveOptions.Version property. In the following example, the use of VCardVersion enumerable to save the contact VCF version 3 format has been demonstrated.

The similar Java based example for this is:

Accessing List-Unsubscribe Header Information

The List-Unsubscribe header contains the URL for unsubscribing from email lists e.g. advertisements, newsletters, etc. In order to get the List-Unsubscribe header, one need to use the ListUnsubscribe property of the ImapMessageInfo class. The following example demonstrate the use of the ListUnsubscribe property to get the List-Unsubscribe header.

The similar Java based example for this is:

There’s many other features, enhancement, and bug fixes included in this release. Here you can get the detail!

When time allows you can check out API examples at Github, talk about this release and other API related issues in our forum.