繁体   English   中英

c#winforms从Outlook模板文件创建电子邮件

[英]c# winforms create email from outlook template file

我正在使用winforms创建邮件,如下所示:

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);
            }
        }

是否可以从Winforms应用程序中实际将电子邮件地址/主题插入已保存的Outlook模板(.oft文件)中?

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM