在Windows Server 2012 for VB应用程序中安装CDO.DLL的先决条件是什么?



我正在将服务器从Windows 2003升级到2012 R2。我们的一个VB6应用程序使用CDO.dll表示MAPI,即用于发送邮件。

我的问题是:

  1. 如何安装/注册 CDO.DLL?

  2. 安装 CDO.DLL 的先决条件是什么?

  3. 是否需要在服务器中安装 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
Microsoft不再

开发或支持CDO 1.21。您可以从 https://www.microsoft.com/en-us/download/details.aspx?id=42040 下载独立版本的 MAPI 以及 CDO 1.21。它最后一次更新是在 2014 年,预计不会有新的错误修复。功能方面,它在过去 15 年中没有更新。

您可以切换到 Outlook 对象模型(命名空间对象大致对应于MAPI.Session对象(。

你也可以使用Redemption(我是它的作者( - 它的RDOSession对象类似于MAPI.Session对象(具有更多额外的功能(。

最新更新