I have the below code in my contact_us.asp page, but after fillng out my form on my contact.htm page, my message "Thank you, your registeration has been sent" message appears but the message isn't being sent. Any help would be greatly appreciated as I cannot see what seems to be the problem
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<%
Const cdoSendUsingMethod = "Const cdoSendUsingPort = 2
Const cdoSMTPServer = "Const cdoSMTPServerPort = "Const cdoSMTPConnectionTimeout = "Const cdoSMTPAuthenticate = "Const cdoBasic = 1
Const cdoSendUserName = "Const cdoSendPassword = "
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields
Dim FirstName, Surname, Email, Message
FirstName = Request.Form("FirstName")
LastName = Request.Form("Surname")
Email = Request.Form("Email")
Message = Request.Form("Message")
' Get a handle on the config object and it's fields
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
' Set config fields we care about
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "127.0.0.1"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSMTPConnectionTimeout) = 20
.Item(cdoSendUserName) = "userA@domain.com"
.Item(cdoSendPassword) = "testing"
.Update
End With
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
With objMessage
.To = "userB@domain.com"
.From = "userA@domain.com"
.Subject = "YSA Contact Info"
.TextBody = "SMTP Relay Test Send @ " & Now() & vbCrLf & "Surname: " & Surname & vbCrLf & "First Name: " & FirstName & vbCrLf & "Email: " & Email & vbCrLf & "Message: "& Message
.Send
End With
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
%>
<font size = "8" face = "Arial">"Thank you, your registration has been sent"</font>
</body>
</html>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<%
Const cdoSendUsingMethod = "Const cdoSendUsingPort = 2
Const cdoSMTPServer = "Const cdoSMTPServerPort = "Const cdoSMTPConnectionTimeout = "Const cdoSMTPAuthenticate = "Const cdoBasic = 1
Const cdoSendUserName = "Const cdoSendPassword = "
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields
Dim FirstName, Surname, Email, Message
FirstName = Request.Form("FirstName")
LastName = Request.Form("Surname")
Email = Request.Form("Email")
Message = Request.Form("Message")
' Get a handle on the config object and it's fields
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
' Set config fields we care about
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "127.0.0.1"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSMTPConnectionTimeout) = 20
.Item(cdoSendUserName) = "userA@domain.com"
.Item(cdoSendPassword) = "testing"
.Update
End With
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
With objMessage
.To = "userB@domain.com"
.From = "userA@domain.com"
.Subject = "YSA Contact Info"
.TextBody = "SMTP Relay Test Send @ " & Now() & vbCrLf & "Surname: " & Surname & vbCrLf & "First Name: " & FirstName & vbCrLf & "Email: " & Email & vbCrLf & "Message: "& Message
.Send
End With
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
%>
<font size = "8" face = "Arial">"Thank you, your registration has been sent"</font>
</body>
</html>