2013-05-18 107 views
0

我创建使用的WinForms像这样一个邮件:C#的WinForms从Outlook模板文件创建电子邮件

private void CreateOutlookEmail(string addresses) 
     { 
      try 
      { 
       Outlook.Application outlookApp = new Outlook.Application(); 
       Outlook.MailItem mailItem = (Outlook.MailItem)outlookApp.CreateItem(Outlook.OlItemType.olMailItem); 
       mailItem.Subject = "This is the subject"; 
       mailItem.To = addresses; 
       mailItem.Body = "This is the message."; 
       mailItem.Importance = Outlook.OlImportance.olImportanceLow; 
       mailItem.Display(false); 
      } 
      catch (Exception eX) 
      { 
       throw new Exception("cDocument: Error occurred trying to Create an Outlook Email" 
            + Environment.NewLine + eX.Message); 
      } 
     } 

是否有可能实际上是插入的电子邮件地址/主题为从保存的Outlook模板(.OFT文件)在一个winforms应用程序?

OFT文件将位于应用程序的根目录中。

回答

1

您是否需要修改现有的OFT文件?您可以使用Redemption及其RDOSession.GetMessageFromMsgFile

+0

这看起来正确。将研究它。谢谢 –