2011-12-04 10 views
0

私はaspを知らないので小さな問題があります。しかし私の叔父のウェブサイトのために作成されたページはASPにあり、フォームも同様です。私は仕事に自分のフォームを取得する問題を抱えているとエラーを検索し、fasthostからpdfを見つけたと私はこのコードをしようとしているが、私は情報を送信するために私の電子メールアドレスを置くと名前などの他の情報。ASPフォームフォームに他のフィールドを追加したり、フォームに他のフィールドを追加したりする

これは私がしようとしているコードです:

dim oCdoMsg, oCdoConfg, strReferer, strServer, 
strClientIP, strServerIP, blnSpam 

set oCdoMsg = server.createobject("CDO.Message") 


strReferer = request.servervariables("HTTP_REFERER") 
strServer = Replace(request.servervariables("SERVER_NAME"), "www.", "") 
strClientIP = request.servervariables("REMOTE_ADDR") 
strServerIP = request.servervariables("LOCAL_ADDR") 
strFrom = "[email protected]" & strServer 


intComp = inStr(strReferer, strServer) 
     If intComp > 0 Then 
      blnSpam = False 
     Else 
      ' Spam Attempt Block 
      blnSpam = True 
     End If 


oCdoMsg.to = request.form("email") 
oCdoMsg.from = strFrom 
oCdoMsg.Subject = "CDO Test Mail" 
oCdoMsg.Textbody = "This test mail has been sent from 
server " 
oCdoMsg.Textbody = oCdoMsg.Textbody & 
request.servervariables("LOCAL_ADDR") & " via CDO mail 
objects." 


strMSSchema = 
"http://schemas.microsoft.com/cdo/configuration/" 
Set oCdoConfg = Server.CreateObject("CDO.Configuration") 
oCdoConfg.Fields.Item(strMSSchema & "sendusing") = 2 
oCdoConfg.Fields.Item(strMSSchema & "smtpserver") = 
"smtp.fasthosts.co.uk" 
oCdoConfg.Fields.Update 
Set oCdoMsg.Configuration = oCdoConfg 


If NOT blnSpam Then 
oCdoMsg.send 
strResult = "Mail Sent." 
Else 
strResult = "Mail Not Sent." 
End If 
response.write strResult 


set oCdoMsg = nothing 
set oCdoConfg = nothing 

を、私はこれで任意の助けをいただければ幸い、今のウェブサイトにあるコードは、500エラーが表示されます。だから私は上記のコードを使用する必要があります。ドメインの電子メールをどこに追加するか、名前のようなフォームの他の部分を上記のコードに取り込む方法については、助けが必要です。

おかげ

答えて

0

は、まず、あなたは、詳細なエラーhttp://goo.gl/Ao3Ssを有効にする必要があります。 次に、エラーが表示されます。
そして、それはVBScript's multiline syntaxを調査する必要があるようです。なぜなら、いくつかの行があなたのコードに構文エラーを引き起こすからです。 いくつかの例:

間違っ:

dim oCdoMsg, oCdoConfg, strReferer, strServer, 
strClientIP, strServerIP, blnSpam 

strMSSchema = 
"http://schemas.microsoft.com/cdo/configuration/" 

oCdoMsg.Textbody = "This test mail has been sent from 
server " 

正しい:

dim oCdoMsg, oCdoConfg, strReferer, strServer, _ 
strClientIP, strServerIP, blnSpam 

strMSSchema = _ 
"http://schemas.microsoft.com/cdo/configuration/" 

oCdoMsg.Textbody = "This test mail has been sent from server " 

は、これらのすべてを考えてみましょう。

関連する問題