0 votes

Imap login is successful but emails do not download. Last network operation failed.

In my application log, it has hundreds of exception related to network operation failed.

2019-10-03 04:19:30,571 FolderName: Inbox, Message: Last network operation failed.

2019-10-03 02:54:47,133 FolderName: [Gmail]/All Mail, Message: Last network operation failed.

Please let me know why does it happen and how do I prevent this to happen and successfully download emails.


by (1.2k points)

1 Answer

0 votes

Those log entries are not from Mail.dll.

Most likely you were expectantly disconnected from the server.
Mail.dll throws an exception in such case. I assume you caught the exception, ignored it and tried to perform more operations. Thus you get "Last network operation failed." error.

When you get a network error you need to dispose Imap class, create new instance and reconnect.

by (298k points)