<%@ Language=VBScript %> <% Option Explicit %> <% 'The header/footer for the email. Const strHeader = "Information Technology Program " Const strFooter = "" 'Who does this go to? MAKE SURE TO CHANGE THIS TO YOUR EMAIL ADDRESS! Const strTo = "you@ualr.edu" 'This information is optional Dim strFrom, strSubject, strRedirectURL, strFromPath strFrom = Request.Form("txtSendToEmailAddress") if Len(strFrom) = 0 then strFrom = strTo strSubject = Request.Form("txtEmailSubject") if Len(strSubject) = 0 then strSubject = "Information Technology Program" strRedirectURL = Request.Form("urlSendTo") if Len(strRedirectURL) = 0 then strRedirectURL = "/" strFromPath = Request.Form("urlFromPath") if Len(strFromPath) = 0 then strFromPath = "UNKNOWN" Dim strBody strBody = strHeader & ( vbCrLf & vbCrLf ) strBody = strBody & ( "FORM: " & strFromPath & vbCrLf ) & _ ( "FORM submitted at " & Now() & vbCrLf & vbCrLf ) dim ix, formElementName, formElementValue, prefix, fldName For ix = 1 to Request.Form.Count formElementName = Request.Form.Key(ix) formElementValue = Request.Form.Item(ix) ' what type of field was that on the form? prefix = Left(formElementName,3) ' and throw away prefix to get actual field name fldName = Mid(formElementName,4) ' but change periods to spaces for readability fldName = Replace(fldName, "."," ") Select Case prefix ' if the prefix indicates this is a form field of interest... Case "txt","sel","rad","cbo","lst","chk": ' if user didn't answer this question, say so... if Len(formElementValue) = 0 then formElementValue = "Unchanged" ' then tack on the name of the field and the answer strBody = strBody & (fldName & ": " & formElementValue & vbCrLf) End Select Next strBody = strBody & ( vbCrLf & strFooter ) 'Time to send the email Dim ObjSendMail Set ObjSendMail = CreateObject("CDO.Message") 'This section provides the configuration information for the remote SMTP server. ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network). ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.ualr.edu" ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False) ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 ' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password. 'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication 'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="" 'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="" ObjSendMail.Configuration.Fields.Update 'End remote SMTP server configuration section== ObjSendMail.To = strTo ObjSendMail.Subject = strSubject ObjSendMail.From = strFrom ' we are sending a text email.. simply switch the comments around to send an html email instead 'ObjSendMail.HTMLBody = "this is the body" ObjSendMail.TextBody = strBody ObjSendMail.Send Set ObjSendMail = Nothing 'Send them to the page specified Response.Redirect strRedirectURL %>