Click here to Skip to main content
15,886,593 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 :-
VB
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

Go Through the below link, here is the example
Here[^]

Thanks
--RA
 
Share this answer
 
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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900