-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstoreinfo.aspx
105 lines (87 loc) · 3.32 KB
/
storeinfo.aspx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<%@ import Namespace="System.Web.Mail" %>
<%@ Page Language="vb" debug="true"%>
<%
Dim formdata As NameValueCollection = Request.Form()
Dim name as String
Dim company as String
Dim email as String
Dim phone as String
Dim address1 as String
Dim address2 as String
Dim city as String
Dim state as String
Dim zip as String
Dim strBody as String
name = formdata.item("name")
company = formdata.item("company")
email = formdata.item("email")
phone = formdata.item("phone")
address1 = formdata.item("address1")
address2 = formdata.item("address2")
city = formdata.item("city")
state = formdata.item("state")
zip = formdata.item("zip")
If name <> "" And (email <> "" Or phone <> "" OR (address1 <> "" AND city <> "" AND state <> "")) Then
'Create an instance of the MailMessage class
Dim objMM as New MailMessage()
'Set the subject
objMM.Subject = "Web Site Info Submission"
'Set the properties
If email.tolower.indexof("subject:") > -1 _
Or name.tolower.indexof("subject:") > -1 _
Or phone.tolower.indexof("subject:") > -1 _
Or email.tolower.indexof("dbssda.com") > -1 _
Or company.tolower.indexof("subject:") > -1 Then
objMM.To = "[email protected]"
objMM.Subject = "Possible Submission Spam"
Else
End IF
objMM.From = "[email protected]"
'Send the email in text format
objMM.BodyFormat = MailFormat.Text
'(to send HTML format, change MailFormat.Text to MailFormat.Html)
'Set the priority - options are High, Low, and Normal
objMM.Priority = MailPriority.Normal
strBody = "Name: " & name & vbCR
strBody = strBody & "Company: " & company & vbCR
strBody = strBody & "Email: " & email & vbCR
strBody = strBody & "Phone: " & phone & vbCR
strBody = strBody & "Address: " & vbCR
strBody = strBody & address1 & vbCR
if( address2 <> "" ) Then strBody = strBody & address2 & vbCR
strBody = strBody & city & ", " & state & " " & zip & vbCR
strBody = strBody & "Submitted: " & date.now.toString()
'Set the body - use VbCrLf to insert a carriage return
objMM.Body = strBody
Try
Dim out As IO.StreamWriter
out = System.IO.File.CreateText(server.mappath("info_data_files\" & Date.Now.ToString("yyyy-MM-dd_hh-mm-ss") & ".txt"))
out.WriteLine(strBody)
out.Close()
Catch ex as Exception
response.write(ex.message)
End Try
Dim oldServ as String
oldServ = SmtpMail.SmtpServer
'SmtpMail.SmtpServer = "bizmail.cnjnet.com"
SmtpMail.SmtpServer = "smtp.1and1.com"
try
SmtpMail.Send(objMM)
catch ex as Exception
try
Dim out2 As IO.StreamWriter
out2 = System.IO.File.CreateText(server.mappath("info_data_files\error" & Date.Now.ToString("yyyy-MM-dd_hh-mm-ss") & ".txt"))
out2.WriteLine(ex.Message)
out2.Close()
catch ex2 as Exception
end try
'response.write(ex.message)
Response.Redirect("thanks.aspx?error-on-send=1")
end try
SmtpMail.SmtpServer = oldServ
Response.Redirect("thanks.aspx")
Else
Response.Redirect("default.aspx?msg=1&name="& name & "&company=" & company & "&email=" & email & "&phone=" & phone & "&address1=" & address1 & "&address2=" &address2 & "&city=" &city & "&state=" &state & "&zip=" &zip)
End If
%>