圖片 - >http://i.stack.imgur.com/bKvVv.jpg什麼是這個登錄窗口?使用VBScript發送電子郵件
當我使用下面的腳本來連接到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"
感謝
約翰
從此信息中不清楚它爲什麼會提示。抱歉。 – 2012-02-16 00:22:30