How to dispose of SMTP attachment after sending the email

@vvaidya your post here has been closed: SMTP and delete file error

The image has a 404 error so I can’t see what it is anymore. Does anyone know how to dispose of SMTP email attachments?

I don’t remember, but I must probably be referring to something like this

1 Like

No worries, I appreciate the response. I’ll use the garbage collect method for now, just figured there’d be an easy way to dispose of only the mail message.

I’m using SMTP, so I haven’t declared a system.net.mail.attachment object myself, it seems like it’s done under the hood with UiPath somehow. Therefore I’m not sure how to reference it (like you did with the ‘messages’ variable) in my workflow.