Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Outlook IO
Hi to all,
 
I have developed a software (CRM) and sending quotations from Microsoft Outlook.
All the mail credentials for the mail comes from server pages.
I have used 'Microsoft.Office.Interop' namespace.
Following is the code for reference :-
Imports System.Net
Imports Microsoft.Office.Interop.Outlook
Imports Microsoft.Office.Interop
 
    Public Function OutlookCall()
        Dim pdfFile As String = "c:\Quotations\Quotation for #" & Session("QType").ToString + " " + Session("CustEnqID").ToString & ".pdf"
        'Take an instance of the Outlook App 
        Dim oOutlook As New Outlook.Application()
        ' Create an instance of the MailItem 
        Dim oMailitem As Outlook.MailItem
        ' Create an instance of the Attachment 
        Dim oAttach As Outlook.Attachment
        oMailitem = oOutlook.CreateItem(Outlook.OlItemType.olMailItem)
        oMailitem.To = Session("EmailID").ToString
        oMailitem.CC = "abc@abc.com"
        oMailitem.Subject = "Quotation from Abc Pvt. Ltd."
        oMailitem.Body = "Please download an Attachment for quotation requested Abc Pvt. Ltd."           
        'txtFilepath is a text box that contains the path for attachment. 
        'Attach the file Path to the Mail Item 
        oMailitem.Attachments.Add(pdfFile)
        'PING….Displays the Outlook along with the To,Cc,Subject and Attachment 
        oMailitem.Display()
    End Function
Then I used this function on local machine it works properly, but when I publish this on IIS, it displays an error as :-
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005.
 
Please guide...
Thanks in Adv.
Posted 29-Jan-12 20:53pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Go Through the below link, here is the example
Here[^]
 
Thanks
--RA
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This will not work. Because outlook is client side not server side.
you can use Mail Server to sending quotations.
the mail server can be Microsoft Exchange server, or any like gmail,hotmail etc.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 290
1 Jochen Arndt 165
2 DamithSL 125
3 PIEBALDconsult 110
4 Garth J Lancaster 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 30 Jan 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100