Exchange アカウントを使用して電子メールを送信するスクリプトをセットアップしようとしています。vbscript で CDO (または同等のもの) を使用したいと考えています。目標は、Exchange アカウントの送信済みフォルダーを介して電子メール通信を追跡することです。エクスチェンジ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- )です。 us / library / 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 に答える