Hello
I have a form which is saved as a data access page (.html) and in it there is a button which when the user click on it it should perform a certain action. The code is to send the form as an e-mail ,I get and error in the asp code which says Object required'Server', (9058552)
The code is as follows
sub btnsubmit_OnClick
Dim MyBody
Dim MyCDONTSMail
Set MyCDONTSMail =Server.CreateObject("CDONTS.NewMail")
MyCDONTSMail.From= "
[email protected]"
MyCDONTSMail.To= "
[email protected]"
MyCDONTSMail.Subject="user Request"
MyBody = "<html>"
MyBody = MyBody&"<body>"
MyBody = MyBody&"<form method='post'action='localhost/sendemail.asp'>"
MyBody = MyBody&"Date:<input type='textbox' id='txtdate'value="&Request.Form("txtreqdate")&"> <br>"
MyBody = MyBody&"From:<input type='textbox' id='txtfrom' value="&Request.Form("txtfrom")&"> <br>"
MyBody = MyBody&"Name:<input type='textbox' id='txtname'value="&Request.Form("txtname")&"> <br>"
MyBody = MyBody&"Dir/Section:<input type='textbox' id='txtdirsection'value="&Request.Form("txtdirsect ion")&"> <br>"
MyBody = MyBody&"CPR No:<input type='textbox' id='txtcprno'value="&Request.Form("txtcpr")&"> <br>"
MyBody = MyBody&"Telephone No:<input type='textbox' id='txttelno'value="&Request.Form("txttelephone")& "> <br>"
MyBody = MyBody&"Position:<input type='textbox' id='txtposition'value="&Request.Form("txtposition" )&"> <br>"
MyBody = MyBody&"Type of Service:<input type='textbox' id='txttype'value="&Request.Form("selecttype")&" "&Request.Form("txttemptodate")&"> <br>"
MyBody = MyBody&"Body:<input type='textbox' id='rtbbody'value="&Request.Form("txtjustification ")&"><br>"
MyBody = MyBody&"<input type='submit' id='btnapprove' text='Approve'>"
MyBody = MyBody&"</form>"
MyBody = MyBody&"</body>"
MyBody = MyBody&"</html>"
MyCDONTSMail.Body=MyBody
MyCDONTSMail.BodyFormat = 0
MyCDONTSMail.MailFormat = 0
MyCDONTSMail.Importance = 2
MyCDONTSMail.Send
set MyCDONTSMail=nothing
end sub