Does anybody know a good way to catch and prevent the error, when a file for some reason is locked for reading and processing?
Executing API 'CreateFile' failed with error number 32.
Error code 32 is ERROR_SHARING_VIOLATION . So the mailer cannot read the attachment file because something else is reading it.
Besides the fact that you cannot really reproduce it until it happens, I cannot really find a way to catch this error upfront. I am using the file_exists function to check upfront if all documents exists, and even though all attachments can be found, at the time of sending the mail at occasions you get this error.
The only solution I can think of now is to set the AccountRetryAttempts to 2 times to tackle this problem. But it's not the fanciest solution, anyone has experiences with this?