使用interop DCOM对象在C#中打开outlook [英] Open outlook in C# using interop DCOM object

查看:74
本文介绍了使用interop DCOM对象在C#中打开outlook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





这是我的要求。需要使用带有html标签和css的大数据的正文打开Outlook。我尝试在href标记中使用mailto,因为数据太长,无法在Outlook中加载完整数据。后来我继续使用Microsoft.Interop outlook,并能够在开发中成功打开outlook。但是当部署到IIS时,我得到以下错误。

Hi,

Here is the requirement i have. Need to open outlook with body having large data with html tags and css. I tried using mailto in a href tag, since data was too long it couldn't load full data in outlook. Later i went on with using Microsoft.Interop outlook and was able to open outlook successfully in dev. But when deployed to IIS i got below error.
"

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). 





在Outlook的DCOM配置中添加了所有权限。仍然没有解决方案任何人都可以帮助解决这个问题或任何其他解决方案,以实现我的要求。



我尝试过:



将设置添加到DCOM配置

"

Added all permission in DCOM config of Outlook. Still no solution. Can anyone help to resolve this issue or any other solution to achieve my requirement.

What I have tried:

Adding the Settings to DCOM config

推荐答案

您不能在Web应用程序中使用Outlook Interop。在非用户环境中不支持任何Office应用程序,即:IIS等服务。



您必须直接与客户端的任何邮件服务器进行交互。使用,像Exchange。如何做到这完全取决于您用来发送这些电子邮件的邮件服务器和其他要求,例如需要让Web应用程序以使用该网站的人的身份发送电子邮件。
You can NOT use Outlook Interop in a web application. None of the Office applications are supported in a non-user environment, i.e.: services, like IIS.

You would have to interact directly with whatever mail server your client is using, like Exchange. How you do that depends entirely on the mail server you're using to send these emails and other requirements, like the need to have the web application send the email as the person using the web site.


这篇关于使用interop DCOM对象在C#中打开outlook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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