2016-06-23 16 views
0

私は「530 5.7.1認証が必要なサーバーの応答だった」に直面しています。下記の私のSENDMAIL.VBS下記のSMTP接続:認証資格情報を提供するにもかかわらず、エラー:認証失敗

Const ForReading = 1, ForWriting = 2, ForAppending = 8 
 

 
Dim ArgTo_s 
 
Dim ArgSubject_s 
 
Dim ArgMsgAttachFile_s 
 
Dim ArgMsgBodyFile_s 
 

 
ArgTo_s = "" 
 
ArgSubject_s = "" 
 
ArgMsgAttachFile_s = "" 
 
ArgMsgBodyFile_s = "" 
 

 
ArgTo_s = Wscript.Arguments(0) 
 
ArgSubject_s = Wscript.Arguments(1) 
 
ArgMsgBodyFile_s = Wscript.Arguments(2) 
 

 
IF Wscript.Arguments.count > 3 then 
 
    ArgMsgAttachFile_s = Wscript.Arguments(3) 
 
End If 
 

 
SMTPServerName_s = "smtp.rediffmail.com" 
 

 
' -- Open file and get message body -- Start -- 
 
Set MsgBody_fso = CreateObject("Scripting.FileSystemObject") 
 
Set MsgBody_file = MsgBody_fso.OpenTextFile(ArgMsgBodyFile_s, ForReading) 
 
MsgBody_s = MsgBody_file.ReadAll 
 
MsgBody_file.Close 
 
Set MsgBody_file = Nothing 
 
Set MsgBody_fso = Nothing 
 
' -- Open file and get message body -- End -- 
 

 
' -- Get the Hostname Start -- 
 
Set Shell_o = CreateObject("WScript.Shell") 
 
RegValue_s = "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Hostname" 
 
HostName_s = Shell_o.RegRead(RegValue_s) 
 
' -- Get the Hostname End -- 
 

 
Set objMessage = CreateObject("CDO.Message") 
 
objMessage.Subject = ArgSubject_s & " (Anonymous Application EMail)" 
 
objMessage.From = UCase("[email protected]") 
 
objMessage.To = ArgTo_s 
 
objMessage.TextBody = MsgBody_s 
 

 
If ArgMsgAttachFile_s <> "" Then 
 
    objMessage.AddAttachment ArgMsgAttachFile_s 
 
End If 
 

 

 
objMessage.Configuration.Fields.Item _ 
 
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]" 
 

 
objMessage.Configuration.Fields.Item _ 
 
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "100000567" 
 

 
objMessage.Configuration.Fields.Item _ 
 
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
 

 
'Name or IP of Remote SMTP Server 
 
objMessage.Configuration.Fields.Item _ 
 
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.rediffmail.com" 
 

 
'Server port (typically 25) 
 
objMessage.Configuration.Fields.Item _ 
 
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
 

 
objMessage.Configuration.Fields.Item _ 
 
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 
 

 
objMessage.Configuration.Fields.Update 
 

 
objMessage.Send

はスクリーンショットです:あなたは、ユーザ名とパスワードを追加したものの enter image description here

答えて

0

、あなたのスクリプトは、サーバーを教えてくれないようです認証を行う。次のコードを追加し

試してみてください。

objMessage.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic 
+0

はあなたのHardikありがとう、残念ながら、規定のコードを使用しているにもかかわらず、私はエラーを取得し続けます。 – NeelDeveloper

+0

オーケー..実行してください:あなたのスクリプトを実行しているシステムから「のtelnet smtp.rediffmail.com 25」を、あなたは、このメールサーバに接続できるかどうかを確認。また 、あなたはrediffmail.comメールサーバを使用しているとして、あなたはあなたのスクリプト –

+0

「telnetのsmtp.rediffmail.com 25」にその正しいユーザ名とパスワードを使用していることを確認して正常に動作し、私はメールサーバーに接続することができます。 – NeelDeveloper

関連する問題