{"action":"opened","issue":{"url":"https://api.github.com/repos/jstedfast/MailKit/issues/246","labels_url":"https://api.github.com/repos/jstedfast/MailKit/issues/246/labels{/name}","comments_url":"https://api.github.com/repos/jstedfast/MailKit/issues/246/comments","events_url":"https://api.github.com/repos/jstedfast/MailKit/issues/246/events","html_url":"https://github.com/jstedfast/MailKit/issues/246","id":106440442,"number":246,"title":"Can't open created msg file in Outlook","user":{"login":"TNTGav","id":3102057,"avatar_url":"https://avatars.githubusercontent.com/u/3102057?v=3","gravatar_id":"","url":"https://api.github.com/users/TNTGav","html_url":"https://github.com/TNTGav","followers_url":"https://api.github.com/users/TNTGav/followers","following_url":"https://api.github.com/users/TNTGav/following{/other_user}","gists_url":"https://api.github.com/users/TNTGav/gists{/gist_id}","starred_url":"https://api.github.com/users/TNTGav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TNTGav/subscriptions","organizations_url":"https://api.github.com/users/TNTGav/orgs","repos_url":"https://api.github.com/users/TNTGav/repos","events_url":"https://api.github.com/users/TNTGav/events{/privacy}","received_events_url":"https://api.github.com/users/TNTGav/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-14T22:22:46Z","updated_at":"2015-09-14T22:22:46Z","closed_at":null,"body":"Hello,\r\n\r\nFirst of all, fantastic library - there has clearly been a lot of effort put into this, and I've been looking for something like this for what feels like an eternity.\r\n\r\nI've just started playing about with MailKit - I have some basic code (based on the samples in this library) to download some messages from an IMAP Server:\r\n\r\n```csharp\r\nusing (var client = new ImapClient(new ProtocolLogger(\"c:\\\\temp\\\\imap.log\")))\r\n{\r\n     client.Connect(\"outlook.office365.com\", 993, SecureSocketOptions.SslOnConnect);\r\n     client.Authenticate(\"notmyreal@emailaddress.com\", \"hunter2\");\r\n     client.Inbox.Open(FolderAccess.ReadOnly);\r\n\r\n     var uids = client.Inbox.Search(SearchQuery.All);\r\n\r\n     foreach (var uid in uids)\r\n     {\r\n        var message = client.Inbox.GetMessage(uid);\r\n        // write the message to a file\r\n        message.WriteTo(string.Format(\"c:\\\\temp\\\\{0}.msg\", uid));\r\n     }\r\n     client.Disconnect(true);\r\n}\r\n```\r\n\r\nThis works successfully and generates the IMAP log and creates the file in said directory. The file will not open in Outlook, I've tried two different machines with Outlook 2013 installed, and tried to open all of them in a test machine with Outlook 2003 and 2007 installed.\r\n\r\nIn all instances I get this warning from Outlook:\r\n\r\n\"We can't open pathtomsg. It's possible the file is already open, or you don't have permission to open it. To check your permissions, right-click the file folder, then click properties.\"\r\n\r\nIf I open the MSG in notepad, it does seem to have the headers at the top followed by the content.\r\n\r\nAny insight at all would be most appreciated, I've kind of fallen at the first hurdle here :)\r\n\r\n\r\n\r\n"}}