0

I had mime contents of mail from gmail and now i want to create .msg file using chilkat and store that contents to .msg file. How could i do that using chilkat any idea.

MsgFilePath = System.IO.Path.Combine(Path, msgFileName + ".msg");
string mimeFile = System.Text.Encoding.ASCII.GetString(mail.MIMEContent);
           success = ObjEmail.SetFromMimeText(mimeFile);           
            if (success)
            {
                byte[] mimeContents = ObjEmail.GetMimeBinary();
                File.WriteAllBytes(MsgFilePath, mimeContents);
            }
mjwills
  • 23,389
  • 6
  • 40
  • 63
  • What does your code do now? What do you want it to do instead? – mjwills Jul 16 '18 at 21:55
  • it is creating .msg file but that file is not able to open with outlook it gives error message. Cannot start microsoft Office Outlook. Cannot open file: Subject.msg. The file may not exist, you may not have permission to open it, or it may be open in another program. – Sushama phalake Jul 17 '18 at 04:14
  • Does the file exist? Is it open in another program? – mjwills Jul 17 '18 at 04:20
  • yes file exist, no is not open anywhere. I am opening the file which is currently generated programmatically. – Sushama phalake Jul 17 '18 at 05:54
  • How are you opening it? What is the full path to the file? – mjwills Jul 17 '18 at 05:57

0 Answers0