SMTP and delete file error

Hi All,

I would like to send an email with attachment, and then delete the file from the temporary folder.
I am using “SMTP” activity for sending an email, but right after the “SMTP” activity I use the “Delete file” activity that is fails.
The error is that another activity is using the file that is why it can not be deleted. I have already tried the “Delay” between “SMTP” and “Delete” activities but I still get this error.

image

Do you have any suggestion how to solve it?

try disposing the attachment before deleting the file. Something like this :
https://sea2.discourse-cdn.com/uipath/uploads/default/optimized/2X/0/07932dac3c85c9fb91be2e765dd59234e289f73b_1_361x500.png

Or

Refer this

2 Likes