|
To setup a feedback form in ASP you need to create object for the mail component installed on the server. Commonly CDOsys mail component is installed on the server. The sample ASP code to use the same in your feedback form is as follows : <%
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = Server.CreateObject("CDO.configuration")
cdoConfig.Fields.Item(sch & "sendusing") = 2
cdoConfig.Fields.Item(sch & "smtpserver") =127.0.0.1
cdoConfig.fields.update
Set cdoMessage = Server.CreateObject("CDO.Message")
Set cdoMessage.Configuration = cdoConfig
cdoMessage.From = "from@yourdomain.com"
cdoMessage.To = "to@yourdomain.com"
cdoMessage.Subject = "form test"
cdoMessage.HTMLBody = "Btext"
cdoMessage.Send
if Err.Number <> 0 then
SendMail = "Email send failed: " & Err.Description & "."
end if
Set cdoMessage = Nothing
Set cdoConfig = Nothing
%> |