画像 --> http://i.stack.imgur.com/bKvVv.jpg
次のスクリプトを使用して Exchange メール サーバーに接続し、電子メール メッセージを送信すると、上記のログイン ウィンドウでドメイン資格情報を要求されます。ログインウィンドウが表示されないようにスクリプトを自動化するにはどうすればよいですか。電子メールを送信するワークステーションは、AD ドメインに参加していません。
Function sendMail(a,b,c)
set objMsg = CreateObject("CDO.Message")
set objConf = CreateObject("CDO.Configuration")
Set objFlds = objConf.Fields
With objFlds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "email server name"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = a
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = b
.Update
End With
strBody = "Script has finished running, 6005 is finished"
With objMsg
Set .Configuration = objConf
.To = c
.From = c
.Subject = "[AUTO] Script has finished running!"
.TextBody = strBody
.Fields.update
.Send
End With
終了機能
sendMail "username","password","my email address"
ありがとう
ジョン