与ASP.NET搭配使用 [英] OutLook with ASP.NET

查看:83
本文介绍了与ASP.NET搭配使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经开发了软件(CRM),并从Microsoft Outlook发送报价.
邮件的所有邮件凭据都来自服务器页面.
我已经使用了"Microsoft.Office.Interop"命名空间.
以下是供参考的代码:-

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


然后,我在本地计算机上使用了此功能,该功能可以正常工作,但是当我在IIS上发布此功能时,它显示错误为:-


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.



请指导...
谢谢Adv.



Please guide...
Thanks in Adv.

推荐答案

转到下面的链接,这里是示例
此处 [ ^ ]

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

Thanks
--RA


这将不起作用.因为Outlook是客户端而不是服务器端.
您可以使用邮件服务器发送报价.
邮件服务器可以是Microsoft Exchange服务器,也可以是gmail,hotmail等之类的邮件.
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.


这篇关于与ASP.NET搭配使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆