norzar2
10-23-2008, 09:13 PM
Thanks for helping I really appreciate it.
I switched servers and now my contact form doesn't work.
My new host gave me some code and now I have the script sending mail again
But the form data is gone
Could someone point out what is missing?
My original submit.asp that worked on last server.
<%
Dim strBody, strSubject, objMail, aRecipients
set objMail = Server.CreateObject("CDO.Message")
strSubject = "Widget - Jones Interactive"
aRecipients = "thebass@widgetjonesinteractive.com"
strBody = ""
for i = 1 to Request.Form.Count - 1
strBody = strBody & "<font color=#FF0000><b>" & Request.Form.Key(i) & ":</b></font> " & Request.Form.Item(i) & "<br />"
next
objMail.To = aRecipients
objMail.From = "contact@website.com"
objMail.Subject = strSubject
objMail.HTMLBody = "<br /><h3>New Message from Website!</h3><br />" & strBody
objMail.Send
Response.Write "<br><p align=center class=style5><b><h1>Thank you for your Message!</h1><br><br><h2>We will be in touch soon!</h2></b><br><BR><BR></p>"
set objMail = Nothing
%>
updated submit.asp that sends mail but doesn't collect my form data
<%
on error resume next
Set oMail = Server.CreateObject("CDO.Message")
'Set oConf = Server.CreateObject("CDO.Configuration")
'Set oFields = oConf.Fields
oMail.From = "thebass@widgetjonesinteractive.com"
oMail.To = "thebass@widgetjonesinteractive.com"
'oMail.cc = "some@otherdomain.com"
oMail.Subject = "Just a CDO test"
oMail.textBody = "Text Body of the message"
'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.widgetjonesinteractive.com"
'Server port (typically 25)
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "thebass@widgetjonesinteractive.com"
oMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "EasyMoneyF3"
oMail.Configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate").Value = 1
' The following fields are only used if the previous authentication value is set to 1 or 2
oMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpaccountname").Value = "thebass@widgetjonesinteractive.com"
oMail.Configuration.Fields.Update
'==End remote SMTP server configuration section==
oMail.Send()
'Clean up server resources.
Set oMail = nothing
If err.number = 0 then
response.write("Mail Send Success")
else
response.write(err.number & " - " & err.description)
end if
%>
I switched servers and now my contact form doesn't work.
My new host gave me some code and now I have the script sending mail again
But the form data is gone
Could someone point out what is missing?
My original submit.asp that worked on last server.
<%
Dim strBody, strSubject, objMail, aRecipients
set objMail = Server.CreateObject("CDO.Message")
strSubject = "Widget - Jones Interactive"
aRecipients = "thebass@widgetjonesinteractive.com"
strBody = ""
for i = 1 to Request.Form.Count - 1
strBody = strBody & "<font color=#FF0000><b>" & Request.Form.Key(i) & ":</b></font> " & Request.Form.Item(i) & "<br />"
next
objMail.To = aRecipients
objMail.From = "contact@website.com"
objMail.Subject = strSubject
objMail.HTMLBody = "<br /><h3>New Message from Website!</h3><br />" & strBody
objMail.Send
Response.Write "<br><p align=center class=style5><b><h1>Thank you for your Message!</h1><br><br><h2>We will be in touch soon!</h2></b><br><BR><BR></p>"
set objMail = Nothing
%>
updated submit.asp that sends mail but doesn't collect my form data
<%
on error resume next
Set oMail = Server.CreateObject("CDO.Message")
'Set oConf = Server.CreateObject("CDO.Configuration")
'Set oFields = oConf.Fields
oMail.From = "thebass@widgetjonesinteractive.com"
oMail.To = "thebass@widgetjonesinteractive.com"
'oMail.cc = "some@otherdomain.com"
oMail.Subject = "Just a CDO test"
oMail.textBody = "Text Body of the message"
'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.widgetjonesinteractive.com"
'Server port (typically 25)
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "thebass@widgetjonesinteractive.com"
oMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "EasyMoneyF3"
oMail.Configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate").Value = 1
' The following fields are only used if the previous authentication value is set to 1 or 2
oMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpaccountname").Value = "thebass@widgetjonesinteractive.com"
oMail.Configuration.Fields.Update
'==End remote SMTP server configuration section==
oMail.Send()
'Clean up server resources.
Set oMail = nothing
If err.number = 0 then
response.write("Mail Send Success")
else
response.write(err.number & " - " & err.description)
end if
%>