I am trying to send email in VB.Net using outlook 2013. I tested as localhost in debug mode and everything is fine. I can send and read Outlook emails in vb.net. However, when I publish the web application and click the send button I get the following exception:
System.Exception: Cannot create ActiveX component. at Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName).
This code gives me the error.
Dim tempApp As Outlook.Application
tempApp = CType(CreateObject("Outlook.Application"), Outlook.Application)
I have tried using.
Dim tempApp As New Outlook.Application
no luck this way either. I have done some searching for this problem and have tried the following solutions given to similar issues and still no fix: ASP.NET Cannot create ActiveX component Cannot create Active X Object
I will do my best to solve this issue and post up any findings I get.
No Office app (including Outlook) can run in a service (such as IIS). Your options are Extended MAPI (C++ or Delphi only), Redemption (I am its author, it wraps Extended MAPI and can be accessed from any language, including C#), EWS (Exchange only) or straight SMTP.