Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Opening New Outlook mail Message from Web Application

Posted on 2008-10-01
8
Medium Priority
?
959 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
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!

 

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

618 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