I am working on a proof of concept application, and the end goal is to create a bunch of msg files with attachemnts. So, we have a parent .msg with multiple child .msg files attached. I have managed to create the child msg's fine, but when it comes to creating the parent msg files with the children attached, it just won't work. I am using Redemption for this, and it's the trial version.

  IRDOSession rdoSession = new RDOSession();
  rdoSession.Logon("", "", false, false, null, false);

  IRDOMail m = rdoSession.GetMessageFromMsgFile(@"c:\test\test.msg", true);

  m.Recipients.Add("****");
  m.Recipients.ResolveAll(null, null);
  m.Subject = "Subject of test .msg";
  m.HTMLBody = "<strong>This is a test body</strong>";
  m.SenderEmailAddress = "******";

  m.Attachments.Add(@"C:\test\t.txt", Type.Missing, Type.Missing, Type.Missing);

  m.SaveAs(@"c:\test\test.msg");

Has anyone come across this issue?

Regards, Chris

有帮助吗?

解决方案

I got the answer to this from Dmitry via email. I basically needed to call m.Save(); instad of m.SaveAs();

m.SaveAs(@"c:\test\test.msg");

replaced with...

m.Save();
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top