通过VBA和Outlook Exchange发送电子邮件

时间:2018-07-06 20:40:24

标签: ms-access access-vba exchange-server cdo.message

因此,多年来,我一直在使用CDO通过POP发送电子邮件,并且没有任何问题。但是,我们将升级到Outlook Exchange电子邮件服务器,并且POP不再可用,它还需要TLS,而CDO不支持我已经阅读的TLS。

这就是我一直在做的:

  Set cdoConfig = CreateObject("CDO.Configuration")
  With cdoConfig.Fields
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "my smtpserver"
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "email@email.com"
    .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    .Update
  End With
  Set objEmail = CreateObject("CDO.Message")
  Set objEmail.Configuration = cdoConfig

过去一直如此。我尝试将smtp服务器更新为smtp.office365.com,并将端口更新为587,但出现以下错误:

The server rejected the sender address.  The server response was: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [MWHPR08CA0030.namprd08.prod.outlook.com]

我目前正在使用Access 2003,我们将很快升级到2015年,但是现在我需要一个可以在2003年使用的解决方案。

谢谢。

0 个答案:

没有答案