Submiting Form Results to the Email

L

Liefer Thole

I have designed a form and I want to receive the results
to my Email. I have written script on ASP but they are not
working. Can someone help wih th code.

When I click Submit it must submit without opening new
mail window.

here are my script: If the is a mistake with them please
rectify and send it to me or if you have working code you
cansnd them to me, Please
<%

Dim FirstName
FirstName = Request("FirstName")

Dim LastName
LastName = Request("LastName")

Dim DOB
DOB = Request("DOB")

Dim Email
Email = Request("Email")

Dim Cell
Cell = Request("Cell")

Dim Course
Course = Request("Course")

dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")

objCDO.To = "(e-mail address removed)"
objCDO.From = "(e-mail address removed)"
objCDO.Subject = "Registration Confirmation"
objCDO.Body = ""
objCDO.send

%>
<p>Thank You For Registering</p>
 
M

MD WebsUnlimited.com

Hi Liefer,

Your code looks correct with the exception that it has no body content.

Set MyCDONTSMail = server.CreateObject("CDONTS.NewMail")
if IsObject(MyCDONTSMail) then
MyCDONTSMail.From= request.form("first_name") & " " &
request.form("last_name") & " <" & request.form("Email")
&">"
MyCDONTSMail.To= "(e-mail address removed)"
MyCDONTSMail.Subject="Product Order -- " & formatcurrency(sTotal)
MyBody = MyBody & "Order number: " & strOrderNumber & vbCrLf
MyBody = MyBody & "Total: " & formatcurrency(sTotal) & vbCrLf &
vbCrLf
MyBody = MyBody & strProducts & vbCrLf &vbCrLf
MyCDONTSMail.Body= MyBody
MyCDONTSMail.Send
set MyCDONTSMail=nothing
else
response.write("Unable to create CDONTS.NewMail")
end if
end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top