0
Set emailObj = CreateObject("CDO.Message")
emailObj.Sender = "[email protected]"
emailObj.To = "[email protected]"
emailObj.Subject = "Test CDO"
emailObj.TextBody = "Test CDO"
Set emailConfig = emailObj.Configuration
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.live.com"
emailConfig.Fields("----/smtpserverport") = 465
emailConfig.Fields("----/sendusing") = 2
emailConfig.Fields("----/smtpauthenticate") = 1
emailConfig.Fields("----/smtpusessl") = true
emailConfig.Fields("----/sendusername") = "[email protected]"
emailConfig.Fields("----/sendpassword") = "*****"
emailConfig.Fields.Update
emailObj.Send
If Err.Number = 0 Then
MsgBox "Done"
End If
If Err.Number <> 0 Then
MsgBox "Can't Proceed"
End If
這是通過live.com發送電子郵件的代碼,但我得到「傳輸失敗連接到服務器」錯誤。任何人都可以幫我解決這個錯誤嗎?傳輸失敗連接到服務器錯誤
我也試過這個,但錯誤仍然相同 –
http://schemas.microsoft.com/cdo/configuration/smtpserver 此鏈接也不能正常工作。 –
確保您的憑據在outlook.com上正常工作。 –