如何在服务器C#上打开Outlook新邮件窗口 [英] How to open Outlook new mail window on server C#

查看:120
本文介绍了如何在服务器C#上打开Outlook新邮件窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此链接打开Outlook新邮件窗口.如何打开Outlook新邮件窗口c#

但是它在本地计算机上运行良好,但是当我将其部署在服务器上时,它显示以下错误.

使用CLSID检索组件的COM类工厂{0006F03A-0000-0000-C000-000000000046}由于以下原因而失败错误:80040154未注册类(HRESULT的异常:0x80040154(REGDB_E_CLASSNOTREG).

Microoft office Outlook安装在本地计算机上而不是服务器上.需要在服务器上安装和配置Outlook.请帮助.谢谢.

解决方案

如果在服务器上运行该代码,谁会看到新创建的消息?即使有本地登录到服务器的用户,IIS也可以在没有桌面会话的情况下运行.

如果您希望消息显示在 client 上,则需要在其中运行代码.为什么不使用mailto网址?它可以在任何浏览器中运行,并且将打开默认的电子邮件客户端.如果您需要比这更复杂的内容,则需要使用JavaScript编写代码,并使用 new ActiveXObject()创建Outlook.Application对象的实例.您只能在IE和您的网站中进行操作必须做到这一点.

I am using this link for open outlook new mail window. How to open Outlook new mail window c#

But It is working fine On Local machine but when I deployed it on server it shows below error.

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

Microoft office outlook is install on local machine not on server.It is required to install and configure outlook on server. Plz help. Thanks.

解决方案

If you run that code on the server, who will see the newly created message? Even if there is a user logged in locally to the server, IIS runs without a desktop session.

If you want the message to be displayed on the client, that is where your code needs to run. Why not use a mailto url? It will work in any browser and the default email client will be opened. If you need something more sophisticated than that, you need to write your code in JavaScript and create an instance of the Outlook.Application object using new ActiveXObject(). You can only do that in IE and your site must be trusted to do that.

这篇关于如何在服务器C#上打开Outlook新邮件窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆