<% Dim Program, Title, Receiver, Msg, ErrMsg, Button, ByteCount, Email, Subject, Body, From, Recipient, CarbonCopy, SMTPServer Program = "Contact.asp" Title = "Contact the Soap Guy" Receiver = "the Soap Guy" Msg = "Use this form to send us an Email" From = "FormsHandler@Web-Site-Builders.com" Recipient = "timlong@videotainments.com" CarbonCopy = "davidjames@netslinger.com" SMTPServer = "" ByteCount = Request.TotalBytes %> Contact the Soap Guys Show
Soap Guys Show - Soap Show Events
Contact the Soap Guys Show

<%If ByteCount > 0 Then StoreForm Validate ErrMsg if ErrMsg = "" then SendEmail end if %> <%else%> <%end if%>
<% Sub StoreForm Email = Request.Form("email") Subject = Request.Form("subject") Body = Request.Form("body") End Sub Sub Validate(ErrMsg) Dim EmailLen, AtPos, DotPos EmailLen = Len(Email) AtPos = instr(1,Email,"@") If AtPos > 0 Then DotPos = instr(AtPos, Email, ".") Else DotPos = 0 if Email = "" or EmailLen < 9 or AtPos = 0 or DotPos = 0 or DotPos + 2 > EmailLen then ErrMsg="We need your E-mail address." ElseIf Subject = "" Then ErrMsg="We need a Subject Line for the message." ElseIf Body = "" Then ErrMsg="OK! What is the message?" end if end sub Sub SendEmail Dim objMail if SMTPServer = "" then Set objMail = Server.CreateObject("CDONTS.NewMail") else Set objMail = Server.CreateObject("CDO.Message") objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network). objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False) objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 end if objMail.From = From objMail.Subject = Subject objMail.To = Recipient objMail.CC = CarbonCopy BodyText = "" & Body & "

From: " & Email & "" If SMTPServer = "" then objMail.BodyFormat=0 objMail.MailFormat=0 objMail.Body = BodyText else ObjMail.HTMLBody = BodyText End if if instr(LCASE(bodytext),"http")=0 then objMail.Send end if Set objMail = Nothing Msg="Your email has been sent " & Receiver & "!" end sub %>