<%@ LANGUAGE="VBSCRIPT" %> <% option explicit %> <% Response.Buffer = True %> <% '*********************************************************************** ' COPYRIGHT NOTICE ' Code Example : Self Submitting "Contact Us" Form Using CDOSYS ' Author : Christopher Williams of ' www.CJWSoft.com and www.PowerASP.com ' You can use this code anywhere as long as this copyright notice ' remains with the code and the link to www.PowerASP.com remains on the ' form page this code is used on ' ' (c) Copyright 2000 - 2005 by CJWSoft / PowerASP All rights reserved '*********************************************************************** %> <% 'Declaring Variables Dim smtpserver,youremail,yourpassword,ContactUs_Name,ContactUs_Email,strCAPTCHA,SessionCAPTCHA Dim ContactUs_Subject,ContactUs_Body,Action,IsError,ContactUs_Company,ContactUs_Area,ContactUs_Phone ' Edit these 3 values accordingly smtpserver = "mail.onecom.com" youremail = "admin@efe.net" yourpassword = "8085" ' Grabbing variables from the form post ContactUs_Name = Request("ContactUs_Name") ContactUs_Email = Request("ContactUs_Email") ContactUs_Subject = Request("ContactUs_Subject") ContactUs_Body = Request("ContactUs_Body") ContactUs_Company = Request("ContactUs_Company") ContactUs_Area = Request("ContactUs_Area") ContactUs_Phone = Request("ContactUs_Phone") 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 Function CheckCAPTCHA(valCAPTCHA) SessionCAPTCHA = Trim(Session("CAPTCHA")) Session("CAPTCHA") = vbNullString if Len(SessionCAPTCHA) < 1 then CheckCAPTCHA = False exit function end if if CStr(SessionCAPTCHA) = CStr(valCAPTCHA) then CheckCAPTCHA = True else CheckCAPTCHA = False end if End Function %> Register to win a free corporate identity package from design house technologies
Header image  
REBUILDING THE REVOLUTION  
line decor
  HOME  : APPLICATIONS : DESIGN : ABOUT : WIN A FREE DESIGN :   
line decor

 
 
REGISTER & WIN A FREE CORPORATE IDENTITY PACKAGE FROM DHT

 

<% If Action = "SendEmail" Then ' Here we quickly check/validate the information entered ' These checks could easily be improved to look for more things If IsValidEmail(ContactUs_Email) = "False" Then IsError = "Yes" Response.Write("You did not enter a valid email address.
") End If If ContactUs_Name = "" Then IsError = "Yes" Response.Write("You did not enter a Name.
") End If If ContactUs_Subject = "" Then IsError = "Yes" Response.Write("You did not enter a Subject.
") End If If ContactUs_Body = "" Then IsError = "Yes" Response.Write("You did not enter a Body.
") End If strCAPTCHA = Trim(Request.Form("strCAPTCHA")) if CheckCAPTCHA(strCAPTCHA) <> true then IsError = "Yes" End If End If ' If there were no input errors and the action of the form is "SendEMail" we send the email off If Action = "SendEmail" And IsError <> "Yes" Then Dim strBody ' Here we create a nice looking html body for the email strBody = "" strBody = strBody & "" strBody = strBody & "" strBody = strBody & "" strBody = strBody & "" strBody = strBody & "HTMLMail" strBody = strBody & "" strBody = strBody & "" strBody = strBody & "Contact Us Form submitted at " & Now() & vbCrLf & "

" strBody = strBody & "From http://" & Request.ServerVariables("HTTP_HOST") & vbCrLf & "
" strBody = strBody & "IP " & Request.ServerVariables("REMOTE_ADDR") & vbCrLf & "
" strBody = strBody & "Name" & " : " & " " & Replace(ContactUs_Name,vbCr,"
") & "
" strBody = strBody & "Email" & " : " & " " & Replace(ContactUs_Email,vbCr,"
") & "
" strBody = strBody & "Company" & " : " & " " & Replace(ContactUs_Company,vbCr,"
") & "
" strBody = strBody & "Area of Interest" & " : " & " " & Replace(ContactUs_Area,vbCr,"
") & "
" strBody = strBody & "Phone" & " : " & " " & Replace(ContactUs_Phone,vbCr,"
") & "
" strBody = strBody & "Subject" & " : " & " " & Replace(ContactUs_Subject,vbCr,"
") & "
" strBody = strBody & "
" & Replace(ContactUs_Body,vbCr,"
") & "
" strBody = strBody & "
" strBody = strBody & "" strBody = strBody & "" Dim ObjCdo Set ObjCdo = Server.CreateObject("CDONTS.NewMail") ObjCdo.BodyFormat=0 ObjCdo.MailFormat=0 ObjCdo.bcc = "efe@efe.net" ObjCdo.To = youremail ObjCdo.Subject = ContactUs_Subject ObjCdo.From = ContactUs_Email ' we are sending a html email.. simply switch the comments around to send a text email instead ObjCdo.body = strBody 'ObjSendMail.TextBody = strBody ObjCdo.send Set ObjCdo = 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 %> You have been successfully registered with Design Houset! Thank You. !
Here is your registration info:
You are: <% =Replace(ContactUs_Name,vbCr,"
") %>
from <% =Replace(ContactUs_Email,vbCr,"
") %>
Your Company: <% =Replace(ContactUs_Company,vbCr,"
") %>
Your Interest: <% =Replace(ContactUs_Area,vbCr,"
") %>
Your Message: <% =Replace(ContactUs_Body,vbCr,"
") %> <% Else %>

When you register with DESIGN HOUSE we wii offer you FREE Corporate Identity design services if you purchase any service contract, software or consulting time with us.

Make sure you fill the following form completely and give us your contact number so a customer representative can call you. .
.

Name:
Email:
Subject:
Comany Name
Phone:
Area of Interest
   
Message:
Write the characters from the image: This Is CAPTCHA Image
 
<% End If %>

 

Contact us if you feel a little help from business professionals can take your business ahead with less worries about the unknown. .

 
       
  ©1994-2006 Design House Technologies Inc. All rights reserved.