Hi I have simplify this for a better help. Could someone run this and tell me where the error is coming from?
I tried it, error 5.
Its still from the attachment case structure. If you disable the case structure, it successfully deletes the file. I would assume that the attachment process is not releasing the file.
Yes I think the problem is comming from there, but I don't see how to solve it. I don't really see how can I close the file after the attachement processess.
So as I can't solve the attachment issue, I was thinking about solving the email body issue. In my previous attachment, I am trying to read from a file and get that file content and use it as my email body. But when doing that, I get only the last characted read sent to the email body and not the all content. what can I do to sent the all file content to the email body?
Yes, thanks Steve. This sure sounds familiar. I had been fighting this issue for two weeks and discovered this method nestled in the Mail Message constructor. You need to dispose of the file attachment to release the reference from .NET. Your file instance may not even show up in your task manager. If you read back a few posts, Steve already mentioned the dispose method. This is the fix and my VI has been working fine.