2017-08-15 163 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

回答