web app - generate and display email

Am I trying to do the impossible?....

I'm developing a web page wizard ( & C#) that interrogates a couple of internal SQL & Firebird DBs extracting client details and email addresses. From this a new email is to be created and the Recipient and subject fields are populated accordingly with the extracted data.

I know that emails can be automatically sent through web pages, but with the project I am doing, this has the requirement for the email to be 'displayed' to our Secretaries rather than being sent at this point. So is there a way to create and display an email?

My attempts :-( :
1) using the SmtpClient (.send) is fine for firing off emails automatically,  But there is no 'Display'.

2)  I've tried using  Microsoft.Office.Interop.Outlook (Outlook.Application) etc,  the web page just displays 'System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied''

The IIS Web server does have Outlook installed. So is there a way around the above error message via permissions in DCOM Config?

Any ideas would be most welcome!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dan McFaddenSystems EngineerCommented:
Have you thought about organizing the process like so:

1. interrogate internal SQL & Firebird DBs extracting client details and email addresses
2. display the collected information on a page that has an email template layout
3. user reviews the data and clicks send, then the app posts back the data and invokes the SmtpClient.send

It shouldn't be an issue to create a page that simulates the layout of an email.  You will need to display a limited number of fields.  For example:

1. From
2. To
3. CC (if necessary)
4. BCC (if necessary)
5. Subject
6. Body
7. Attachments (if necessary)

Maybe the options to edit certain fields if allowed and then a send button.

As for the Outlook instantiation error: 80070005 Access is denied', that is coming from the identity of the AppPool where the code is running.  Chances are that your are using a default configured AppPool, in this situation, the AppPool identity is running with reduced permissions and needs to granted execute permissions on the COM object.

IMO, dropping Office components on production servers that are Internet available, increases the probability that security issues will arise due to Office as well as the typical monthly issues raised thru the OS.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Seven0fNineAuthor Commented:
Thank you for your assistance
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.