Browse our Products

Aspose.Email for .NET 20.4 Release Notes

All Changes

KeySummaryCategory
EMAILNET-39771Apose.Email SMTP failing in .NET Core 3.1Enhancement
EMAILNET-39737MailMessage AttachSignature in .NET CoreEnhancement
EMAILNET-39783Support for the ability to Ignore exceptionsEnhancement
EMAILNET-39786Get message infos by unique identifiers for Pop3Client and ImapClientEnhancement
EMAILNET-39796Message fails to process with ArgumentExceptionBug
EMAILNET-39799Space getting removed while saving OFT to MSGBug
EMAILNET-39797ArgumentOutOfRangeException occurs when loading MailMessage from an html fileBug
EMAILNET-39773Filtering downloaded messages using ImapQueryBuilder failsBug
EMAILNET-39776Unable to download message listBug
EMAILNET-39770System.ArgumentOutOfRangeException while loading a MSGBug
EMAILNET-39764How to set description(body) for modified occurenceBug
EMAILNET-39790ReplyMessageBuilder.buildresponse fails while building a response if attachments are presentBug
EMAILNET-39789Converted MSG to EML does not have From addressBug
EMAILNET-39792MSG to EML output wrong (Plain Text)Bug
EMAILNET-39791ImapClient crashes application even called in try catchBug

Enable mail clients activity logging in a .NET Core projects

Now SmtpClient, Pop3Client, ImapClient and EWSClient activity can be logged by modifying (or adding) appsettings.json file in .NET Core project. For that, it is needed to set the special settings into the file.

To turn on logging, the following settings must be included into the log file, containing the correct path:


 "SmtpDiagnosticLog" - logging activity of SmtpClient

"ImapDiagnosticLog" - logging activity of ImapClient

"Pop3DiagnosticLog" - logging activity of Pop3Client

"EWSDiagnosticLog" - logging activity of EWSClient

"WebDavDiagnosticLog" - logging activity of Dav.ExchangeClient

Here is an example of appsettings.json.


 {

 "SmtpDiagnosticLog": "smtp.log",

 "SmtpDiagnosticLog_UseDate": true,

 "ImapDiagnosticLog": "imap.log",

 "ImapDiagnosticLog_UseDate": true,

 "Pop3DiagnosticLog": "pop3.log",

 "Pop3DiagnosticLog_UseDate": true,

 "EWSDiagnosticLog": "ews.log",

 "EWSDiagnosticLog_UseDate": true,

 "WebDavDiagnosticLog": "webdav.log",

 "WebDavDiagnosticLog_UseDate": true

}

Support for the ability to ignore exceptions

We have prepared a new functionality to ignore exceptions - ExceptionManager class has been added to provide ignore exceptions ability:


 public class ExceptionManager

Code examples:

Set a callback to handle exceptions:


 //exception path: {Module}\{Method}\{Action}\{GUID}

//example: MailMessage\Load\DecodeTnefAttachment\64149867-679e-4645-9af0-d46566cae598

ExceptionManager.IgnoreExceptionsHandler = (exception, path) => { return path.Equals(@"MailMessage\Load"); };  //Ignore all exceptions on MailMessage.Load

Or use an alternative:


 //Ignore all exceptions on MailMessage.Load

ExceptionManager.IgnoreList.Add(@"MailMessage\Load");

It’s possible to ignore all exceptions:


 ExceptionManager.IgnoreAll = true;

Also, you can set a callback for ignored exceptions log:


 ExceptionManager.IgnoreExceptionsLogHandler = message => { Console.WriteLine("--- EXCEPTION IGNORED ---" + message); };

The user will be notified, that the exception can be ignored by an error message. For example:


 Exceptioin message:

AsposeArgumentException: properties should not be empty.

If you want to ignore an exception and want to proceed further then you can use:

ExceptionManager.IgnoreList.Add("MailMessage\\Load\\DecodeTnefAttachment\\64149867-679e-4645-9af0-d46566cae598")

Invalid TNEF Attachment will be interpreted as regular attachment.