<%@ Language="VBScript" %> <% Option Explicit %> <% '-------------------------------------------------------------------------------- ' ' Microsoft CDO for NTS 1.2 Library ' ' Constants for VBScript ' '-------------------------------------------------------------------------------- '---- CdoAttachmentTypes Values ---- Const CdoFileData = 1 Const CdoEmbeddedMessage = 4 '---- CdoBodyFormats Values ---- Const CdoBodyFormatHTML = 0 Const CdoBodyFormatText = 1 '---- CdoEncodingMethod Values ---- Const CdoEncodingUUencode = 0 Const CdoEncodingBase64 = 1 '---- CdoFolderTypes Values ---- Const CdoDefaultFolderInbox = 1 Const CdoDefaultFolderOutbox = 2 '---- CdoImportance Values ---- Const CdoLow = 0 Const CdoNormal = 1 Const CdoHigh = 2 '---- CdoMailFormats Values ---- Const CdoMailFormatMime = 0 Const CdoMailFormatText = 1 '---- CdoMessageFormats Values ---- Const CdoMime = 0 Const CdoText = 1 '---- CdoObjectClass Values ---- Const CdoSession = 0 Const CdoMessages = 16 Const CdoRecipients = 17 Const CdoAttachments = 18 Const CdoFolder = 2 Const CdoClassTotal = 29 Const CdoMsg = 3 Const CdoRecipient = 4 Const CdoAttachment = 5 Const CdoAddressEntry = 8 '---- CdoRecipientTypes Values ---- Const CdoTo = 1 Const CdoCc = 2 Const CdoBcc = 3 '----- Start Page ------ Function Pad(string, length) Dim nPad nPad = length - Len(string) If nPad > 0 Then Pad = string & Space(nPad) Else Pad = string End If End Function Dim subject, recipient, redirect, sitename, name, email, displaymsg Dim objMail, HTML Dim excludeFields, padLength Const colLength = 40 excludeFields = Array("subject", "recipient", "redirect", "sitename", "FirstName", "LastName", "email", "displaymsg") subject = request("subject") recipient = request("recipient") redirect = request("redirect") sitename = request("sitename") name = request("FirstName") & " " & request("LastName") email = request("email") displaymsg = request("displaymsg") If (request("pad") <> "") Then padLength = request("pad") Else padLength = colLength End If HTML = "
*** Details ***


" &vbCrLf If name <> " " Then HTML = HTML & Pad("Name: ", colLength) & name & "
" & vbCrLf End If If email <> "" Then HTML = HTML & Pad("Email: ", colLength) & email & "
" & vbCrLf End If Dim bFound, objItem, counter, fieldName ' Go through all fields in form and output into mail body HTML = HTML & "
" & vbCrLf For Each objItem In Request.Form bFound = False counter = 0 ' Exclude certain fields from the body of mail message Do While Not bFound And counter <= UBound(excludeFields) If 0 = StrComp(objItem, excludeFields(counter)) Then bFound = True End If counter = counter + 1 Loop If Not bFound Then If Request.Form(objItem) <> "" Then fieldName = Replace(objItem, "_", " ") HTML = HTML & "" & vbCrLf End If End If Next HTML = HTML & "
" & fieldName & ":" & "  " & Request.Form(objItem) & "
" & vbCrLf Set objMail = CreateObject("CDONTS.NewMail") With objMail .From = recipient .To = recipient .Subject = subject .Body = HTML .Importance = cdoHigh .BodyFormat = CdoBodyFormatHTML .MailFormat = CdoMailFormatMime .Send End With Set objMail = nothing %> <%= sitename %>
 
<%= displaymsg %>