【问题标题】:Outlook Com ExceptionOutlook Com 异常
【发布时间】:2014-04-23 07:39:39
【问题描述】:

我有一个 c# .net 应用程序,它打开一个 Outlook 实例并填充电子邮件的密件抄送部分。当我在本地运行 .Net 时,它工作正常。如果我去服务器并打开 IIS 并浏览到应用程序,它工作正常。

当我在 Internet Explorer 中浏览到应用程序时,它不会打开 Outlook 并填充密件抄送。

这是我打开outlook实例的代码。

                Outlook.Application outlookApplication = new Outlook.Application();
                Outlook.MailItem mailItem = (Outlook.MailItem)outlookApplication.CreateItem(Outlook.OlItemType.olMailItem); 
                mailItem.BCC = emailList;
                mailItem.Display(true);

这是来自服务器管理器中事件查看器的警告:

    Exception information: 
Exception type: COMException 
Exception message: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

我缺少什么或者我需要做什么才能使其正常工作?

【问题讨论】:

    标签: c# iis com outlook


    【解决方案1】:

    您的代码在服务器上运行,而不是在客户端上。您需要为此使用客户端脚本 - 假设您的脚本有权实际创建本地 COM 对象并且用户正在使用 IE(没有其他浏览器支持 COM 对象)。

    其次,Outlook 与任何其他 Office 应用程序一样,不能在服务(如 IIS)中使用。

    【讨论】:

    • 我尝试将 a href 与 mailto: 一起使用,但它有字符限制。该应用程序需要处理许多人的电子邮件,这就是为什么我必须找到另一种方法来做到这一点。
    猜你喜欢
    • 2011-01-21
    • 1970-01-01
    • 2011-08-08
    • 2012-02-28
    • 2019-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多