Not able to send mails due to this error

I am creating and sending mails (set up on office 365) using exchange server. I am using EWS server in java to send mails. From a week ago, I am getting the below issue on Windows machines. I have also tried adding a delay of 1 second after adding the attachments. Still, I am facing this problem. The issue has also become very frequent.

ERROR_IRRESOLVABLE_CONFLICT -

The send or update operation could not be performed because the change key passed in the request does not match the current change key for the item., Cannot submit message.SaveStatus: IrresolvableConflict

Can someone please advise what can be done to avoid this error?