<% 'Declare local variables to hold the data from the Input form page that is used above. Dim strTo Dim strSubject Dim strBody 'Strings for recipient, subject, boby Dim objCDOMail 'The CDO object Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory. Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network). Const cdoAnonymous = 0 'Do not authenticate Const cdoBasic = 1 'basic (clear-text) authentication Const cdoNTLM = 2 'NTLM 'First we'll read in the values entered from the form into the Local variables strFrom = Request.Form("to") 'Make sure the From field has no spaces. strTo = Request.Form("to") strSubject = Request.Form("subject") strRedirect = Request.Form("redirect") strBody = "" & vbCrLf strBody = strBody & "----------------------------------------------------------" & vbCrLf strBody = strBody & "Boston Harbor Boat Rental" & vbCrLf & vbCrLf strBody = strBody & "Contact Us Form" & vbCrLf strBody = strBody & "Date: " & Now & vbCRLF strBody = strBody & "----------------------------------------------------------" & vbCrLf & vbCrLf strBody = strBody & "Contact Name: " & Request.Form("name") & vbCrLf strBody = strBody & "E-mail Address: " & Request.Form("email") & vbCrLf strBody = strBody & "Phone Number: " & Request.Form("phone") & vbCrLf & vbCrLf strBody = strBody & "----------------------------------------------------------" & vbCrLf & vbCrLf strBody = strBody & "Questions/Comments: " & Request.Form("comments") & vbCrLf ' Create an instance of the NewMail object. Set objCDOMail = CreateObject("CDO.Message") Set myConfig = CreateObject("CDO.Configuration") Set Flds = myConfig.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoAnonymous .update End With Set objCDOMail.Configuration = myConfig ' Set the properties of the object objCDOMail.From = StrFrom objCDOMail.To = strTo objCDOMail.Subject = strSubject objCDOMail.TextBody = strBody ' There are lots of other properties you can use. ' You can send HTML e-mail, attachments, etc... ' You can also modify most aspects of the message ' like importance, custom headers, ... ' Check the help files for a full list as well ' and the correct syntax. ' Some of the more useful ones I've included samples of here: 'objCDOMail.Cc = "mailto:sschofield@aspfree.com;steve@aspfree.com" Notice this sending to more than one person! 'objCDOMail.Bcc = "sschofield@aspfree.com;steve@aspfree.com" 'objCDOMail.Importance = 1 '(0=Low, 1=Normal, 2=High)im a 'objCDOMail.AttachFile "c:\path\filename.txt", "filename.txt" ' Send the message! objCDOMail.Send ' Set the object to nothing because it immediately becomes ' invalid after calling the Send method + it clears it out of the Server's Memory. Set objCDOMail = nothing Set myConfig = nothing Response.Redirect (strRedirect) %>