When I update to Apsose.Email 19.11 (.NET) from 19.10 the MailMessage object (received by ImapClient.FetchMessage) contains no informations. The object is not null but all relevant fields like Body or Attachments are empty. Also when I choose saveMessage I get a 0 bytes file.
For testing I used the same emails from Gmail and Strato by IMAP.
When I receive the same emails with version 19.10. everything is working. Also when I receive mails with POP3 and version 19.11. everything is working.
Visual Studio Debugger screenshots:
aspose_email_18.104.22.168.PNG (36.7 KB)
aspose_email_22.214.171.124.PNG (32.3 KB)
I have observed the issue shared by you and request you to please share the source MSG file or sample code with IMAP credentials reproducing the issue on your end. Please share the requested information that is reproducing issue on your end so that we may try to reproduce and log the issue in our issue tracking system.
Attachment: Sample code to get emails with IMAP from Gmail. There should be at least 2 mails with attachments in that Gmail account.
aspose_imap_sample.zip (447 Bytes)
Thank you for providing the information. An issue with ID EMAILNET-39682 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
Can you please try using latest Aspose.Email for .NET 20.9 on your end and if there is still an issue please share the feedback with us.
We found a workaround/bug?.
The issue is that calling imapClient.FetchMessageAsync without first calling imapClient.ListMessagesAsync will result in an empty/null MailMessage, so the workaround is to call imapClient.ListMessagesAsync first.
When waiting for new emails using the IMAP IDLE command (imapClient.StartMonitoringAsync), the new mail notification contains the UniqueId for each new email, so there should be no need to call ListMessagesAsync since we already have the UniqueIds. This needs to be fixed or documented!
example code for working and non-working scenarios can be found here:
Thank you for highlighting the example. I have linked that in our issue tracking system for further review and making that part of documentation too after that.