?
Solved

Opening New Outlook mail Message from Web Application

Posted on 2008-10-01
8
Medium Priority
?
958 Views
Last Modified: 2012-05-05
I am trying to open a new outlook mail message from the click of a button on a web page.  My code also creates a new calendar item and attaches it to the email.  The body of the email is populated with data from my database.

I am getting the following error:

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046}

I have added the Microsoft.Office.Interop.Outlook.dll (version 12) to the product.  The dll is in the bin directory.

Everything works fine in development.  It does not work when I post on a production server.

Production server is running windows 2003

Do I need to install Outlook on the production server?
Dim objOutlook As New Outlook.Application
            Dim objOutlookMsg As Object
            Const olMailItem As Object = 0
            'Const olBCC As Integer = 3
            Const olImportanceHigh As Integer = 2
            'Const olCC As Integer = 2
            Const olTo As Integer = 1
 
            'objOutlook = CreateObject("Outlook.Application")
            objOutlookMsg = objOutlook.CreateItem(olMailItem)
            With objOutlookMsg
                Dim objOutlookRecip As Object = .Recipients.Add(strTakingAttorneyEmails)
                objOutlookRecip.type = olTo
                .Subject = strSubject
                .HTMLBody = parser.Parse
                '.Body = "TEST BODY"
                .Importance = olImportanceHigh
                'ADD THE ATTACHMENT TO THE EMAIL
                .Attachments.Add(strCalendarItem)
                .Display() ' use  .send() to send
 
            End With
            objOutlookMsg = Nothing
            objOutlook = Nothing

Open in new window

0
Comment
Question by:cartch2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 22620468
>>Do I need to install Outlook on the production server?

yes and you shouldn't do that!

0
 

Author Comment

by:cartch2008
ID: 22622966
What should I do then??
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 22623159
what are you trying to do exactly?

If you want to send email, you better use System.Net.Mail as shown at http://www.emoreau.com/Entries/Articles/2007/09/Using-SystemNetMail.aspx

If you want to create an appointment, see http://www.ascentium.com/blog/sp/Post57.aspx
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:cartch2008
ID: 22623528
I realize I can do that, but, my requirement from my client is that the new mail message pops up as a new outlook email message on his machine, with the body of the email populated with data from the database.   I can't just use a href mailto: becuase I can't pass all that data to the body of the email.
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 1500 total points
ID: 22623684
are you sure all the users of your wep site are using Outlook?

Can't you just create a web page with all the fields you need and send it using System.Net.Mail?

I think you can use WebDav to acheive it (open a Outlook Message): http://blog.downtownsoftwarehouse.com/2006/10/26/using-net-and-webdav-to-access-an-exchange-server/
0
 

Author Comment

by:cartch2008
ID: 22623869
Yes, I'm sure...absolutely sure
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 22624246
what about WebDav?
0
 

Author Closing Comment

by:cartch2008
ID: 31502222
I've scrapped my plans to use this functionality.  Although I did not try WebDav, I'm confident it would solve thie issue if I were to go ahead and implement it.  So, I am awarding you the points for that fact that you responded.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
The viewer will learn how to count occurrences of each item in an array.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question