我正在尝试使用交换帐户设置脚本以发送电子邮件。我想将 CDO(或等效)与 vbscript 一起使用。目标是通过交换帐户的已发送文件夹跟踪电子邮件通信。我正在使用交换 2007。
问问题
17670 次
1 回答
4
使用 Microsoft NTLM ( http://msdn.microsoft.com/en-us/library/aa378749(v=vs.85).aspx ) 在 CDO 中它是一个 CdoProtocolsAuthentication 枚举 ( http://msdn.microsoft.com/en-我们/图书馆/ms526961(v=exchg.10).aspx )
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
dim objEmail
Set objEmail = CreateObject("CDO.Message")
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")= cdoSendUsingPort
'Name or IP of remote SMTP server
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="exchange"
'Server port
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =25
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpAuthenticate") = cdoNTLM
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/NNTPAccountName") = "USERNAME"
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/SaveSentItems") = TRUE
objEmail.Configuration.Fields.Update
objEmail.From = "FROM <FROM@domain.com>"
objEmail.To = "TO@domain.com"
objEmail.Subject = "SUBJECT"
objEmail.Textbody = "BODY "
objEmail.Send
于 2011-06-08T22:07:42.020 回答