This is my code:
Mail_Message mailMessage = Mail_Message.ParseFromFile(emailPath); //emailPath - it's path to .eml file on my disk
....
.... //I'm sending here mailMessage to method, which is saving this e-mail in my db
....
mailMessage.Dispose();
File.Delete(emailPath); //here I want to delete this file from my disk
I have two problems:
1. Problem with deleting files.
In line "File.Delete(emailPath); I've got an error, that this file is using by another program, and
I can't remove it from my computer. If I want delete it using windows
explorer, there is the same error.
Why? I wrote "mailMessage.Dispose()" ...
I'm sure that this line:
Mail_Message mailMessage = Mail_Message.ParseFromFile(emailPath);
causes problem.
2. My messages are not formatted
mailMessage.BodyHtmlText = null
and my message is no formatted. Everything is in one line, the same font, and so on....
When I open .eml file in outlook express it will look good. It will be formatted correctly.
Has anyone any idea? What can I do?
Grzegorz.