Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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)). 
"

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
Posted
Updated 29-Mar-19 4:27am
Comments
F-ES Sitecore 29-Mar-19 9:34am    
When you launch an app like Outlook via your code the code runs on the server, not the client, the code only seems to work in dev because the server and client are the same machine. When you deploy to an actual web server the code is trying to launch the app on the server but the server has no access to the interactive desktop so it fails. Even if you resolved the security issue your code still wouldn't do what you intend as the email will open on the server with no-one there to click send, it wouldn't appear on the client.

Basically what you're trying to do isn't possible.

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900