%
if len(request("EmailTo")) = 0 then
xerror "Form Needs the EmailTo Field for Destination"
response.end
end if
if len(request("MailSubject")) > 0 then
msg = request("Subject") & chr(10) & chr(10)
else
msg = "Mail Form Fields:" & chr(10) & chr(10)
end if
for each x in request.form
msg = msg & x & ": " & request.form(x) & chr(10)
next
EmailTo = request("EmailTo")
if len(request("EmailFrom")) > 0 then
EmailFrom = request("EmailFrom")
else
EmailFrom = "unknown@unknown"
end if
MailMessage msg, EmailTo, EmailFrom, request("Subject")
sub MailMessage (msg,emailto,emailfrom, subject)
dim MyMail
set MyMail = Server.CreateObject("CDONTS.NewMail")
MyMail.From = EmailFrom
MyMail.To = EmailTo
MyMail.Subject = Subject
MyMail.Body= msg
on Error Resume Next
MyMail.Send
if Err <> 0 Then
xError Err.description
Else
xMessage "Thank You ... Your Form Has Been Succesfully Sent"
End If
On Error GoTo 0
set MyMail = Nothing
End Sub
%>
<%Sub Xerror (xx) %>
<% end sub %>
<%Sub XMessage (xx) %>
<% end sub %>