2010-12-02 40 views
5
CDO.Message.1 error '80040213' 

The transport failed to connect to the server. 

/check.asp, line 25 

asp CDO.Message.1エラー '80040213'トランスポートはサーバーに接続できませんでした。 /check.asp、ライン25

チェックあなたが送信する前にユーザー名とパスワードを追加する必要があり、このコード

<%@ Language=VBScript %> 
<html> 
<head> 
</head> 
<body> 
<% 
dim to_field, message 
to_field = Request.Form("to_field") 
message = Request.Form("message") 
'Create the e-mail server object 
Set objCDOSYSMail = Server.CreateObject("CDO.Message") 
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration") 
'Out going SMTP server 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.example.com" 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 
objCDOSYSCon.Fields.Update 
'Update the CDOSYS Configuration 
Set objCDOSYSMail.Configuration = objCDOSYSCon 
objCDOSYSMail.From = "[email protected]" ' the address you want the email to be from 
objCDOSYSMail.TO = "[email protected]" 'the address the mail is to be sent to 
objCDOSYSMail.Subject = "Subject goes here" 
objCDOSYSMail.HTMLBody = "fffffffffff" 
objCDOSYSMail.Send 
'Close the server mail object 
Set objCDOSYSMail = Nothing 
Set objCDOSYSCon = Nothing 
%> 
<p>Mail sent successfully to address <%=to_field%>!</p> 
</body> 
</html> 

答えて

4

をこの問題を解決するために助けてください。これは、sendusingのフィールドで2の値を使用したためです。つまり、認証を使用しています。

'Your UserID on the SMTP server' 
objCDOSYSCon.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "yourusername" 

'Your password on the SMTP server' 
objCDOSYSCon.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpassword" 
0

あなたはこのコードが機能するために4つの重要設定パラメータが欠落しています。あなたのコードをこれに置き換えれば、確実に機能します。 (個人的にテスト済み)

彼らは認証SSLユーザ名パスワードパラメータです。

objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com" 
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]" 
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "youpasswordforyouremail" 
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1 
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 
関連する問題