通过outlook发送电子邮件时出错,这是否需要服务器应用程序?

要求:我的应用程序需要通过Outlook发送电子邮件。 我可以完成这个使用Outlook = Microsoft.Office.Interop.Outlook;

该应用程序工作正常的开发环境,但我得到一个exception: System.Runtime.InteropServices.COMException(0x80040154):检索与CLSID {0006F03A-0000-0000-C000-000000000046}组件的COM类工厂失败,由于以下错误:80040154类未注册(HRESULTexception:0x80040154(REGDB_E_CLASSNOTREG))

详细:

System.Runtime.InteropServices.COMException (0x80040154): 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)) at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at InvoiceSearchTool.Controllers.emailController.CreateMessageWithAttachment(String invoiceNumber, String recipient, String messageBody) in C:\Projects\KeleInvoice\InvoiceSearchTool\Controllers\emailController.cs:line 38 

我没有在应用程序服务器上安装Outlook。 我需要在服务器上安装outlook吗? 或者例外是由于其他原因? 如何摆脱它?

用于Outlook的CLSID是{0006F03A-0000-0000-C000-000000000046}。 如错误代码所示,它找不到该类。 你需要安装Outlook(你的开发版本也应该安装在应用服务器上)。

(ps – 请打勾如果我是正确的,谢谢!)