0 votes

Has anyone experienced imap.GetMessageByUID(lMsgId) returning null value and how best to overcome?

by

1 Answer

0 votes

If it returns null it means that your server hasn't return any data for the uid you passed as a parameter.

You can turn on logging to be sure that in fact no email is returned:
https://www.limilabs.com/blog/logging-in-mail-dll

In most cases it means that the message was already deleted or moved, possibly in another session by another email client.

Please also make sure that you are using are using GetMessageByUID and not GetMessageByNumber, as uids and numbers can't be mixed.

by (301k points)
...