Sicos1977 / MsgKit

A .NET library to make MSG files without the need for Outlook
204 stars 56 forks source link

Msg file as attachments #26

Closed rafbran closed 6 years ago

rafbran commented 6 years ago

Hello, very useful library. However, I am having a problem. If I try to save an email that has an .msg file as attachment, the attachment doesn't open. It says "resource is busy or you lack sufficient access rights or permissions". Do you know how to fix this?

Thanks

Sicos1977 commented 6 years ago

Can you send me the file that is giving you this error? Please zip the msg file before sending it to sicos2002@hotmail.com

rafbran commented 6 years ago

I sent you an example of a file with the problem. The problem is that the library sets the attachment type to ATTACH_EMBEDDED_MSG, giving me the error. I tried to send it by changing the extension, so that the type changes to ATTACH_BY_VALUE. This way, if I save the attachment and rename it back to .msg extension I can open it. The AttachmentType property is read only, a possible solution is to make it settable so its possible to change it.

Sicos1977 commented 6 years ago

It seems that I already fixed this issue in this commit --> https://github.com/Sicos1977/MsgKit/commit/58b3642b56ff9019e17d856c58b76d9b69c0dd94

But I probably never released a new nuget package with that fix in it. Just grab the source from GitHub and compile it and you should be fine.

rafbran commented 6 years ago

Thank you. It works now. But I adopted another solution. I used your MsgReader library to parse the msg file and forward it other than attach it. Better solution for me. However I opened an issue for that library. I’m not able to use it by parsing a MemoryStream. Can you help me?

Thank you