001.
<%@ LANGUAGE=
"VBSCRIPT"
%>
002.
<% option explicit %>
003.
<% Response.Buffer =
True
%>
004.
<%
005.
006.
007.
008.
009.
Dim
smtpserver,youremail,yourpassword,ContactUs_Name,ContactUs_Email
010.
Dim
ContactUs_Subject,ContactUs_Body,Action,IsError, ContactUs_Company, ContactUs_Phone
011.
012.
013.
smtpserver =
"mail.xxxxx.com"
014.
youremail =
"xxxxxx"
015.
yourpassword =
"xxxxxxxxxx"
016.
017.
018.
ContactUs_Email = Request(
"ContactUs_Email"
)
019.
ContactUs_Company = Request(
"ContactUs_Company"
)
020.
ContactUs_Name = Request(
"ContactUs_Name"
)
021.
ContactUs_Phone = Request(
"ContactUs_Phone"
)
022.
ContactUs_Subject = Request(
"ContactUs_Subject"
)
023.
ContactUs_Body = Request(
"ContactUs_Body"
)
024.
Action = Request(
"Action"
)
025.
026.
027.
028.
Function
IsValidEmail(Email)
029.
Dim
ValidFlag,BadFlag,atCount,atLoop,SpecialFlag,UserName,DomainName,atChr,tAry1
030.
ValidFlag =
False
031.
If
(Email <>
""
)
And
(InStr(1, Email,
"@"
) > 0)
And
(InStr(1, Email,
"."
) > 0)
Then
032.
atCount = 0
033.
SpecialFlag =
False
034.
For
atLoop = 1
To
Len(Email)
035.
atChr = Mid(Email, atLoop, 1)
036.
If
atChr =
"@"
Then
atCount = atCount + 1
037.
If
(atChr >= Chr(32))
And
(atChr <= Chr(44))
Then
SpecialFlag =
True
038.
If
(atChr = Chr(47))
Or
(atChr = Chr(96))
Or
(atChr >= Chr(123))
Then
SpecialFlag =
True
039.
If
(atChr >= Chr(58))
And
(atChr <= Chr(63))
Then
SpecialFlag =
True
040.
If
(atChr >= Chr(91))
And
(atChr <= Chr(94))
Then
SpecialFlag =
True
041.
Next
042.
If
(atCount = 1)
And
(SpecialFlag =
False
)
Then
043.
BadFlag =
False
044.
tAry1 = Split(Email,
"@"
)
045.
UserName = tAry1(0)
046.
DomainName = tAry1(1)
047.
If
(UserName =
""
)
Or
(DomainName =
""
)
Then
BadFlag =
True
048.
If
Mid(DomainName, 1, 1) =
"."
then BadFlag =
True
049.
If
Mid(DomainName, Len(DomainName), 1) =
"."
then BadFlag =
True
050.
ValidFlag =
True
051.
End
If
052.
End
If
053.
If
BadFlag =
True
Then
ValidFlag =
False
054.
IsValidEmail = ValidFlag
055.
End
Function
056.
%>
057.
058.
<html>
059.
060.
<head>
061.
<title>Contact Ayers Welldrilling</title>
062.
</head>
063.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=windows-874"
>
064.
<link rel=stylesheet type=
"text/css"
href=
"../../include/stylesheet.css"
>
065.
066.
<body style=
"font-family: Arial; font-size: 12px;"
>
067.
068.
<%
069.
If
Action =
"SendEmail"
Then
070.
071.
072.
073.
If
IsValidEmail(ContactUs_Email) =
"False"
Then
074.
IsError =
"Yes"
075.
Response.Write(
"<font color="
"red"
">You did not enter a valid email address.</font><br>"
)
076.
End
If
077.
078.
If
ContactUs_Name =
""
Then
079.
IsError =
"Yes"
080.
Response.Write(
"<font color="
"red"
">You did not enter a Name.</font><br>"
)
081.
End
If
082.
083.
084.
If
ContactUs_Phone =
""
Then
085.
IsError =
"Yes"
086.
Response.Write(
"<font color="
"red"
">You did not enter a Phone.</font><br>"
)
087.
End
If
088.
089.
If
ContactUs_Subject =
""
Then
090.
IsError =
"Yes"
091.
Response.Write(
"<font color="
"red"
">You did not enter a Subject.</font><br>"
)
092.
End
If
093.
094.
If
ContactUs_Body =
""
Then
095.
IsError =
"Yes"
096.
Response.Write(
"<font color="
"red"
">You did not enter a Body.</font><br>"
)
097.
End
If
098.
099.
End
If
100.
101.
102.
If
Action =
"SendEmail"
And
IsError <>
"Yes"
Then
103.
104.
Dim
strBody
105.
106.
107.
strBody = strBody &
"<font face="
"Verdana,Geneva,Arial,Helvetica,sans-serif"
">Here we create"
& vbCrlf &
"Submitted at: "
& Now() & vbCrLf &
"<br><br>"
108.
109.
110.
strBody = strBody &
"Company"
&
": "
&
" "
& Replace(ContactUs_Company,vbCr,
"<br>"
) &
"<br>"
111.
strBody = strBody &
"Phone"
&
": "
&
" "
& Replace(ContactUs_Phone,vbCr,
"<br>"
) &
"<br>"
112.
strBody = strBody &
"Name"
&
": "
&
" "
& Replace(ContactUs_Name,vbCr,
"<br>"
) &
"<br>"
113.
strBody = strBody &
"Email"
&
": "
&
" "
& Replace(ContactUs_Email,vbCr,
"<br>"
) &
"<br>"
114.
strBody = strBody &
"Subject"
&
": "
&
" "
& Replace(ContactUs_Subject,vbCr,
"<br>"
) &
"<br>"
115.
strBody = strBody &
"<br>"
& Replace(ContactUs_Body,vbCr,
"<br>"
) &
"<br>"
116.
strBody = strBody &
"</font>"
117.
118.
Dim
ObjSendMail
119.
Set
ObjSendMail = CreateObject(
"CDO.Message"
)
120.
121.
122.
128.
132.
133.
ObjSendMail.Configuration.Fields.Update
134.
135.
136.
137.
ObjSendMail.
To
= youremail
138.
ObjSendMail.Subject = ContactUs_Subject
139.
ObjSendMail.From = ContactUs_Email
140.
141.
142.
ObjSendMail.HTMLBody = strBody
143.
144.
145.
ObjSendMail.Send
146.
147.
Set
ObjSendMail =
Nothing
148.
149.
150.
151.
%>
152.
<div align=
"center"
><center>
153.
<table width=
"540"
border=
"0"
><tr><td><p>
154.
155.
<img src=
"Desktop/ayers-logo.jpg"
alt=
"Ayers Logo"
width=
"307"
height=
"75"
border=
"0"
>
156.
<p> <br>
157.
158.
<font size=
"2"
color=
"#0000FF"
> Message Subject: <% =Replace(ContactUs_Subject,vbCr,
"<br>"
) %></font>
159.
</p>
160.
161.
<p> <br>
162.
<b>Your message has been sent to Ayers Welldrilling - Thank You.</b></font>
163.
<font face=
"Verdana,Geneva,Arial,Helvetica,sans-serif"
size=
"2"
><br> <br>
164.
<br>Please allow a couple days for response.
165.
<br>
If
your message is more urgent, call 440-256-3622
166.
</font>
167.
</p>
168.
169.
</td></tr></table>
170.
<p> <br>
171.
<a href=
"index.html"
title=
"Home"
>
172.
Home
173.
</a>
174.
</p>
175.
</div>
176.
<%
Else
%>
177.
178.
<div align=
"center"
><center>
179.
<table width=
"540"
border=
"0"
><tr><td><p>
180.
<font face=
"Arial, helvetica"
size=
"5"
color=
"#000000"
>
181.
<img src=
"fush/Desktop/ayers-logo.jpg"
alt=
"Ayers Logo"
width=
"307"
height=
"75"
border=
"0"
>
182.
<p>
183.
<b>Information Request and Comments</b></font>
184.
185.
<p><font FACE=
"Arial, helvetica"
Size=2>
186.
We are interested in your comments, information requests, etc...
187.
<br>Please allow a couple days for response.
188.
</td></tr></table>
189.
190.
191.
<form action=
"contact_us.asp"
method=
"POST"
>
192.
<input type=
"hidden"
name=
"Action"
value=
"SendEmail"
>
193.
194.
195.
<table width=
"540"
border=
"0"
>
196.
<tr><td colspan=
"2"
>
197.
<font FACE=
"Arial"
size=
"2"
>
198.
The information below is confidential and will not be distributed.</font>
199.
<hr></td>
200.
</tr>
201.
202.
<tr><td width=
"150"
><font FACE=
"Arial"
size=
"2"
><b>*Name:</b></font></td>
203.
<td>
204.
<input type=
"text"
name=
"ContactUs_Name"
size=
"35"
value=
"<% =ContactUs_Name %>"
>
205.
</td>
206.
</tr>
207.
<tr><td width=
"150"
><font FACE=
"Arial"
size=
"2"
><b>Company:</b></font></td>
208.
<td>
209.
<input type=
"text"
name=
"ContactUs_Company"
size=
"35"
value=
"<% =ContactUs_Company %>"
>
210.
</tr>
211.
<tr><td width=
"150"
><font FACE=
"Arial"
size=
"2"
><b>*Phone:</b></font></td>
212.
<td>
213.
<input type=
"text"
name=
"ContactUs_Phone"
size=
"35"
value=
"<% =ContactUs_Phone %>"
>
214.
</td>
215.
</tr>
216.
<tr><td><font FACE=
"Arial"
size=
"2"
><b>*E-mail:</b></font></td>
217.
<td>
218.
<input type=
"text"
name=
"ContactUs_Email"
size=
"35"
value=
"<% =ContactUs_Email %>"
>
219.
</td>
220.
</tr>
221.
222.
223.
<tr><td><font FACE=
"Arial"
size=
"2"
><b>*Subject:</b></font></td>
224.
<td>
225.
<input type=
"text"
name=
"ContactUs_Subject"
value=
"<% =ContactUs_Subject %>"
size=
"35"
>
226.
</td>
227.
</tr>
228.
229.
<tr><td valign=
"top"
><font FACE=
"Arial"
size=
"2"
><b>*Comments:</b></font></td>
230.
<td>
231.
<textarea cols=
"40"
rows=
"10"
name=
"ContactUs_Body"
><% =ContactUs_Body %></textarea>
232.
</td>
233.
</tr>
234.
235.
<tr><td colspan=
"2"
><font FACE=
"Arial"
size=
"2"
><b>*</b>Required</font></td>
236.
</tr>
237.
238.
<tr>
239.
<td> </td>
240.
<td>
241.
<font FACE=
"Arial"
size=
"3"
>
242.
<input TYPE=
"submit"
NAME=
"Engage"
VALUE=
"Send Message"
tabindex=
"15"
>
243.
<input TYPE=
"reset"
VALUE=
"Reset"
name=
"B2"
tabindex=
"16"
>
244.
245.
<b> Thank you!</b></font>
246.
247.
</td>
248.
</tr>
249.
</table>
250.
251.
</form>
252.
253.
<p><font face=
"Arial"
size=
"2"
><a href=
"index.html"
>Home</a></font>
254.
</center></div>
255.
256.
<%
End
If
%>
257.
258.
</body>
259.
260.
</html>