在Windows Server 2012中为VB应用程序安装CDO.DLL有哪些先决条件
问题描述:
我正在将服务器从Windows 2003升级到2012 R2。 我们的一个VB6应用程序为MAPI使用CDO.dll,即发送邮件。在Windows Server 2012中为VB应用程序安装CDO.DLL有哪些先决条件
我的问题是:
如何安装/注册CDO.DLL?
安装CDO.DLL的先决条件是什么?
我是否需要在我的服务器中安装Outlook以供应用程序发送邮件?
Set objMAPI = New MAPI.Session
objMAPI.Logon ShowDialog:=False, NewSession:=False, ProfileInfo:=gobjINI.gstrExchangeServer & vbLf & gobjINI.gstrProfile
'Add a new mesage to the OUtbo Messages Collection
Set objMSG = objMAPI.Outbox.Messages.Add
'Add the recipient list specified in INI File
'Check if this is a multiple Recipient List (names or groups seperated by semicolons!)
If InStr(1, Recipients, ";") Then
objMSG.Recipients.AddMultiple Recipients, CdoTo
objMSG.Recipients.Resolve
Else
'This section is for handling of single recipient name
'Be aware that this may be an email group list name !
Set objRecipients = objMSG.Recipients.Add(Recipients)
objRecipients.Resolve
End If
'Add Subject Line, Message Content and Send Message
objMSG.Subject = Subject
objMSG.Text = Message
'The Update method adds all our assignments to collecttion
objMSG.Update
'Now let's actually send the message
objMSG.Send
'End MAPI Session
objMAPI.Logoff
Set objMAPI = Nothing
MailSend = True
答
CDO 1.21不再被开发或由Microsoft支持。您可以从https://www.microsoft.com/en-us/download/details.aspx?id=42040下载独立版本的MAPI以及CDO 1.21。它最后在2014年更新,预计不会有新的错误修复。功能方面,它在过去的15年中没有更新过。
您可以切换到Outlook对象模型(Namespace对象大致对应于MAPI.Session
对象)。
您也可以使用Redemption - 其RDOSession对象类似于MAPI.Session
对象(具有更多额外的功能)。
感谢您关注此事。因此,要使用MAPI,我们需要MS Outlook。 MAPI功能是发送接收邮件,所以它可以在没有MS Outlook的情况下工作。 –
您可以安装独立版本的MAPI,但它赢得了“你有什么好处,因为不会有任何现有的配置文件,并且你将无法连接到Exchange 2013或2016。 –
好,所以outlook安装必须与MAPI一起工作? –