[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Opening New Outlook mail Message from Web Application

Posted on 2008-10-01
8
Medium Priority
?
961 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
  • 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
Industry Leaders: 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!

 

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

Independent Software Vendors: 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

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Suggested Courses

834 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