关于cdo发邮件出错的问题,错误号:0x800ccc15
错误信息
The message could not be sent to the SMTP server. The transport error code was 0x800ccc15. The server response was not available
代码
Imports System.Web.Mail
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'SmtpMail.SmtpServer = "LIUZHMAIL"
'SmtpMail.Send("lim@liuzh.moroa.cr", "ddk@liuzh.moroa.cr", "dk", "d")
''
Dim myMsg
Dim myConfig
Dim Flds
Const cdoSendUsingPort = 2
Const cdoBasic As Integer = 1
myMsg = CreateObject("CDO.Message")
myConfig = CreateObject("CDO.Configuration")
Flds = myConfig.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "www.163.net"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xx"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxx"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Update()
End With
With myMsg
.Configuration = myConfig
.To = "xx@163.net"
.From = "xx@163.net"
.Subject = "xx"
.HTMLBody = "xx"
.Send()
End With
myMsg = Nothing
myConfig = Nothing
Flds = Nothing
End Sub
End Class
?