I would use the property MailBoxInfo of ImapClient to get the names of the special folders like Trash or SPAM, but in GMail, many times it’s not working, and returns null in all properties (only inbox is set). Any other way to get that info?
I’m using .NET 4.8 and Aspose.Mail 22.12. image.png (26.1 KB)
GMail may use labels that do not correspond directly to IMAP folder names.
You can get folders by client.ListFolders() method and then map to special folders.
Try this approach and spare a minute to share your feedback, please.
Ok, thanks, I knew that method (that requires more development and execution time), but I expected that the other method would be faster. Although, it’s strange, but when I say sometimes it’s working and many others not, I’m referring to the same account…
Unfortunately, we don’t know the cause of the random behavior you described. In any case, you can share more details if you discover any other details related to this problem.
Also, try enabling activity logging on the client; the server’s responses may shed some light on the problem.