Can someone help? I have an asp contact page which works properly, except that the messagebox does not display, and I cannot see an obvious reason why.
Thanks
------------------------------------
------------------------------------
Thanks
------------------------------------
Code:
<html>
<head>
</head>
<body>
<form method=Post action="">
<p class="leftNormalText">Your name</p>
<input type="text" name="t1" size="20"><br>
<p class="leftNormalText">Your email</p>
<input type="text" name="t2" size="20"><p>
<p class="leftNormalText">Your message</p>
<textarea rows="4" name="st" cols="50"></textarea><p>
<input type=submit value=Submit></form>
<%
Dim JMail, intComp, strReferer, strServer, strClientIP, strServerIP, blnSpam
Dim stname,st
Dim t1name,t1,t2name,t2
t1name = "Sender's name"
t1 = Request.Form("t1")
t2name = "Sender's email"
t2 = Request.Form("t2")
stname = "Message"
st = Request.Form("st")
Set JMail = Server.CreateObject("JMail.SMTPMail")
strReferer = request.servervariables("HTTP_REFERER")
strServer = Replace(request.servervariables("SERVER_NAME"),"[URL unfurl="true"]www.","")[/URL]
strClientIP = request.servervariables("REMOTE_ADDR")
strServerIP = request.servervariables("LOCAL_ADDR")
'spam checker
intComp = inStr(strReferer, strServer)
If intComp > 0 Then
blnSpam = False
Else
' Spam Attempt Block
blnSpam = True
End If
JMail.ServerAddress = "smtp." & strServer & ":25"
JMail.AddRecipient "info@club.org.uk"
JMail.Sender = "info@club.org.uk"
JMail.Subject = "Website Contact Form"
JMail.Body = t1name & vbcrlf&_
t1 & vbcrlf&_
t2name & vbcrlf&_
t2 & vbcrlf&_
stname & vbcrlf&_
st & vbcrlf&_
now()
if NOT blnSpam Then
JMail.Execute
strResult = "Mail Sent."
Else
strResult = "Mail Not Sent."
End If
Response.Write("<" & "script language=VBScript>")
Response.Write("MsgBox """ & strResult & """<" & "/script>")
Set JMail = Nothing
%>
</body>
</html>