Browse our Products

Aspose.Email for Java 21.1 Release Notes

All Changes

KeySummaryCategory
EMAILNET-40027Email client authentication customizationFeature
EMAILJAVA-34778EWSClient, support for CalendarViewFeature
EMAILJAVA-34777Support to validate SMTP connection credentialsFeature
EMAILNET-40010MSG extraction from PST: Object reference not set to an instance of an objectBug
EMAILNET-40030Use TFM file naming conventions to simplify project filesBug
EMAILNET-40019Special characters breaking in appointmentsBug
EMAILNET-40023Pictures inserted (AttachMethod = 6) in MapiJournal cannot be displayed normallyBug
EMAILNET-40020The body (BodyContentType.Rtf) of mapijournal in pst cannot be displayed correctlyBug
EMAILNET-40021Parsing the Outlook Email message streamBug

New Features

Validate Mail Server Credentials Without Sending Email

Sometimes it is necessary to verify credentials without sending an email. Aspose.Email now supports this feature. The validateCredentials() method was added to ImapClient, Pop3Client and SmtpClient for this purpose.

Code sample:

try (ImapClient imapClient = new ImapClient(
        server.ImapUrl, server.ImapPort, "username", "password", SecurityOptions.Auto)) {
    imapClient.setTimeout(4000);

    if (imapClient.validateCredentials()) {
        // to do something
    }
}

try (Pop3Client pop3Client = new Pop3Client(
        server.Pop3Url, server.Pop3Port, "userName", "password", SecurityOptions.Auto)) {
    pop3Client.setTimeout(4000);

    if (pop3Client.validateCredentials()) {
        // to do something
    }
}

try (SmtpClient smtpClient = new SmtpClient(
        server.SmtpUrl, server.SmtpPort, "username", "password", SecurityOptions.Auto)) {
    smtpClient.setTimeout(4000);

    if (smtpClient.validateCredentials()) {
        // to do something
    }
}

Email Client Authentication Customization

We have added the ability to authenticate to an SMTP, POP or IMAP server using a specific authentication method. This allows you to set the authentication method for the mail client explicitly.

ImapClient.getSupportedAuthentication, Pop3Client.getSupportedAuthentication, SmtpClient.getSupportedAuthentication - Gets enumeration of the authentication types supported by server.

ImapClient.setAllowedAuthentication, SmtpClient.setAllowedAuthentication, Pop3Client.setAllowedAuthentication - Gets or sets enumeration of the authentication types allowed by user.

Code sample:

imapClient.setAllowedAuthentication(ImapKnownAuthenticationType.Plain);
pop3Client.setAllowedAuthentication(Pop3KnownAuthenticationType.Plain);
smtpClient.setAllowedAuthentication(SmtpKnownAuthenticationType.Login);

Returning the Recurring Calendar Items Within the Specified Date Range

Now, EWSClient supports the return of the recurring calendar items within the range specified by StartDate and EndDate.

The following API has been added:

  • AppointmentQueryBuilder.setCalendarView(Date startDate, Date endDate, int maxEntriesReturned) - If the CalendarView is specified, the service returns a list of single calendar items and occurrences of recurring calendar items within the range specified by StartDate and EndDate. maxEntriesReturned - Describes the maximum number of results. (Value <= 0 for all results).

Code sample:

ExchangeQueryBuilder builder = new ExchangeQueryBuilder();
builder.getAppointment().setCalendarView(startDate, endDate, -1);

Appointment[] appointments = client.listAppointments(builder.getQuery());