我想從我的vbscript代碼發送電子郵件,下面的代碼在我的機器上正常工作,但是當我更換我的機器時,代碼不能再發送電子郵件。 運行過程中沒有發生錯誤或問題,但沒有發送/發送郵件。 有沒有其他人遇到這樣的問題?電子郵件不發送
Set objMessage = CreateObject("CDO.Message")
With objMessage
.From = SendFrom
.To = SendTo
.Subject = "Subject"
.Textbody = ""
.HTMLBody = "<b>Body</b>"
With .Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTP.Gmail.Com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "Username"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "Password"
.Update
End With
.Send
End With
你能'的telnet smtp.gmail.com 25'從生產機器?如果不是,你會得到什麼錯誤? – 2013-02-18 18:21:52
這不需要兩臺機器都安裝Outlook嗎?這可能是問題嗎? – Andrew 2013-02-18 22:04:10
@Andrew:不,Outlook不是必需的。 – 2013-02-19 00:11:11