<%@ LANGUAGE="VBSCRIPT" %> <% option explicit %> <% Response.Buffer = True %> <% 'Declaring Variables Dim smtpserver,youremail,yourpassword,ContactUs_Name,ContactUs_Email Dim Comments,Action,Subject,SubjectOther,UserTel ' Edit these 3 values accordingly smtpserver = "smtp.1and1.com" youremail = "loretta@lorettacrogersbooks.com" yourpassword = "loretta01" ' Grabbing variables from the form post ContactUs_Name = Request("ContactUs_Name") ContactUs_Email = Request("ContactUs_Email") Comments = Request("Comments") Subject = Request("Subject") SubjectOther = Request("SubjectOther") UserTel = Request("UserTel") Action = Request("Action") ' Used to check that the email entered is in a valid format Function IsValidEmail(Email) Dim ValidFlag,BadFlag,atCount,atLoop,SpecialFlag,UserName,DomainName,atChr,tAry1 ValidFlag = False If (Email <> "") And (InStr(1, Email, "@") > 0) And (InStr(1, Email, ".") > 0) Then atCount = 0 SpecialFlag = False For atLoop = 1 To Len(Email) atChr = Mid(Email, atLoop, 1) If atChr = "@" Then atCount = atCount + 1 If (atChr >= Chr(32)) And (atChr <= Chr(44)) Then SpecialFlag = True If (atChr = Chr(47)) Or (atChr = Chr(96)) Or (atChr >= Chr(123)) Then SpecialFlag = True If (atChr >= Chr(58)) And (atChr <= Chr(63)) Then SpecialFlag = True If (atChr >= Chr(91)) And (atChr <= Chr(94)) Then SpecialFlag = True Next If (atCount = 1) And (SpecialFlag = False) Then BadFlag = False tAry1 = Split(Email, "@") UserName = tAry1(0) DomainName = tAry1(1) If (UserName = "") Or (DomainName = "") Then BadFlag = True If Mid(DomainName, 1, 1) = "." then BadFlag = True If Mid(DomainName, Len(DomainName), 1) = "." then BadFlag = True ValidFlag = True End If End If If BadFlag = True Then ValidFlag = False IsValidEmail = ValidFlag End Function %> Contact
HomeContact

Loretta C. Rogers

also writing as L.W. Rogers


 

Contact Loretta

Thank you for contacting me about my books. I will respond to your comment and/or question as soon as I can.

 

<% If Action = "SendEmail" Then Dim strBody ' Here we create a nice looking html body for the email strBody = strBody & "Contact Us Form submitted at " & Now() & vbCrLf & "

" strBody = strBody & "Name" & " : " & " " & Replace(ContactUs_Name,vbCr,"
") & "
" strBody = strBody & "Email" & " : " & " " & Replace(ContactUs_Email,vbCr,"
") & "
" strBody = strBody & "Subject" & " : " & " " & Replace(Subject,vbCr,"
") & "
" strBody = strBody & "Other" & " : " & " " & Replace(SubjectOther,vbCr,"
") & "
" strBody = strBody & "Telephone" & " : " & " " & Replace(UserTel,vbCr,"
") & "
" strBody = strBody & "Comments" & " : " & " " & Replace(Comments,vbCr,"
") & "
" strBody = strBody & "
" 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") = smtpserver 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 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") = youremail ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = yourpassword ObjSendMail.Configuration.Fields.Update 'End remote SMTP server configuration section== ObjSendMail.To = youremail ObjSendMail.Subject = "Contact from Website" ObjSendMail.From = ContactUs_Email ' we are sending a html email.. simply switch the comments around to send a text email instead ObjSendMail.HTMLBody = strBody 'ObjSendMail.TextBody = strBody ObjSendMail.Send Set ObjSendMail = Nothing ' change the success messages below to say or do whatever you like ' you could do a response.redirect or offer a hyperlink somewhere.. etc etc Response.Redirect "thanks.htm" %> <% Else %>

What do you want to comment on?

Other:

Enter your comments in the space provided below:

Tell us how to get in touch with you:

Name
E-mail
Tel

<% End If %>

Thank You,

Loretta C. Rogers
Author