站内搜索
分类列表
本类阅读排行
本类推荐文章
- ASP技巧:让Len,Left,Right函数识...
- 用ASP实现IE地址栏参数的判断
- 如何实现ASP.NET网站个性化
- 如何在Asp.net中使用HtmlArea编辑...
- 用ASP.Net实现在线压缩和解压缩
- ASP实现不存在的网页就自动发送邮...
- 用ASP取出HTML里面的图片地址的函...
- asp.net跳转页面的三种方法比较
- 一个Winsock组件
- 用WinSock设计Chat程序(转)
- 在MFC应用中深入定制WebBrowser控...
- 这几天有人问关于编应.dll的问题,...
- 在Visual J++中编写ASP COM组件(转...
- 一个显示Grid的VBScript对象
- 好东西,快来看呀:(转载自中华网...
广告
CDONTS & DHCP发E-mail例子
作者: 来源: 点击: 日期:2007-3-29 23:34:27
CDONTS & DHCP发E-mail例子
I have developed code using ASP and CDONTS which will send an email to the person requesting the information.
The Site Visitor 's DHCP IP
Date/Time
The Region From Where The Visitor Has Made a Hit like India, US etc
Which browser is being used
******************************
<%
'code by Manikantan
'Web Developer
'3rd Agenda
'Nungambakkam
'Chennai
'India
Dim RIPAddress
Dim UAgent
Dim strgetTime
RIPAddress = Request.ServerVariables("REMOTE_ADDR")
reg=split(RIPaddress,".")
'check for American regions
' Increase The Numbers into Subdomains to Find The Exact Location
if cint(reg(0))<=207 and cint(reg(0))>=204 then
region="North America or South America or Caribbean or Saharan Africa"
end if
if reg(0)="196" or reg(0)="198" or reg(0)="199" or reg(0)="200" or reg(0)="216" or reg(0)="208" or reg(0)="209" then
region="American regions Inclucding Caniberra and Saharian region"
end if
'Check for Asian Regions
'Increase the Check for Accuracy
if reg(0)="202" or reg(0)="203" or reg(0)="210" or reg(0)="211" or reg(0)="169" or reg(0)="61" or reg(0)="24" then
region="Asian pacific region like India,Afghan"
end if
if region <>"Asian pacific region like India,Afghan" then
if region<>"American regions Inclucding Caniberra and Saharian region" thenregion="European Region,North Africa,Russian region"
end if
end if
UAgent = Request.ServerVariables("HTTP_USER_AGENT")
strgetTime = FormatDateTime(Now(),vbLongDate)
' you need cdonts.dll for this
' Anyother Mailer like abmailer.dll can be used instead
Dim myMail
Set myMail = Server.CreateObject("CDONTS.NewMail")
myMail.To = "youremail@home.com"
myMail.From = "admin@yourwebsite.com"
myMail.Subject = "You Have a Visitor " & strgettime
Body = "A visitor had visited your site:" & vbCrlf
Body = Body & "His DHCP Ip Was: " & RIPAddress & vbCrlf
Body = Body & "His Agent Was: " & UAgent & vbCrlf
Body = Body & "Date: " & strgetTime & vbCrlf
Body = Body & "The Hit was Approximately From" & vbcrlf
Body = Body & "<b>" & region & "</b>" & vbcrlf
I have developed code using ASP and CDONTS which will send an email to the person requesting the information.
The Site Visitor 's DHCP IP
Date/Time
The Region From Where The Visitor Has Made a Hit like India, US etc
Which browser is being used
******************************
<%
'code by Manikantan
'Web Developer
'3rd Agenda
'Nungambakkam
'Chennai
'India
Dim RIPAddress
Dim UAgent
Dim strgetTime
RIPAddress = Request.ServerVariables("REMOTE_ADDR")
reg=split(RIPaddress,".")
'check for American regions
' Increase The Numbers into Subdomains to Find The Exact Location
if cint(reg(0))<=207 and cint(reg(0))>=204 then
region="North America or South America or Caribbean or Saharan Africa"
end if
if reg(0)="196" or reg(0)="198" or reg(0)="199" or reg(0)="200" or reg(0)="216" or reg(0)="208" or reg(0)="209" then
region="American regions Inclucding Caniberra and Saharian region"
end if
'Check for Asian Regions
'Increase the Check for Accuracy
if reg(0)="202" or reg(0)="203" or reg(0)="210" or reg(0)="211" or reg(0)="169" or reg(0)="61" or reg(0)="24" then
region="Asian pacific region like India,Afghan"
end if
if region <>"Asian pacific region like India,Afghan" then
if region<>"American regions Inclucding Caniberra and Saharian region" thenregion="European Region,North Africa,Russian region"
end if
end if
UAgent = Request.ServerVariables("HTTP_USER_AGENT")
strgetTime = FormatDateTime(Now(),vbLongDate)
' you need cdonts.dll for this
' Anyother Mailer like abmailer.dll can be used instead
Dim myMail
Set myMail = Server.CreateObject("CDONTS.NewMail")
myMail.To = "youremail@home.com"
myMail.From = "admin@yourwebsite.com"
myMail.Subject = "You Have a Visitor " & strgettime
Body = "A visitor had visited your site:" & vbCrlf
Body = Body & "His DHCP Ip Was: " & RIPAddress & vbCrlf
Body = Body & "His Agent Was: " & UAgent & vbCrlf
Body = Body & "Date: " & strgetTime & vbCrlf
Body = Body & "The Hit was Approximately From" & vbcrlf
Body = Body & "<b>" & region & "</b>" & vbcrlf
CDONTS & DHCP发E-mail例子 评论
