Solved

Opening New Outlook mail Message from Web Application

Posted on 2008-10-01
8
950 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 69

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 69

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
 

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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 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 69

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now