2017-08-15 157 views
0

我想发送一条消息,但出现此错误。有没有人有任何想法,为什么我得到这个错误?传统ASP中传输失败连接到服务器

On Error Resume Next 
    mTo = "*****" 


      mBody = "<strong>New Signup</strong><br><br> " & _ 
        "Time: " & now() & "<br><br> " 

    If (mTo <> "") Then 
     Set objMail = Server.CreateObject("CDO.Message") 
     With objMail 
      .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' SendUsingPort 
      .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.*****.ca" ' Name or IP of remote SMTP server 
      .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ' Server port 
      .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpConnectionTimeout") = 60 
      .Configuration.Fields.Update 
      .From = "Home Style - New Signup <[email protected]******.ca>" 
      .To = mTo 
      .Subject = "Home Style - New Signup" 
      .HTMLBody = mBody 
      .Send 
     End with 
     set objMail = nothing 
    End If 

    If Err.Number <> 0 Then 

    Response.Write (Err.Description) 

    Response.End 

请让我知道我在哪里丢失了一些代码。

+0

如果这是经典的ASP,那么你为什么还要将其标记为ASP.NET?为什么要标记.NET Framework中的类SmtpClient? – mason

回答