欢迎光临
我们一直在努力

CDONTS & DHCP发E-mail例子

建站超值云服务器,限时71元/月

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
mymail.body = body
mymail.send
set mymail = nothing
%>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » CDONTS & DHCP发E-mail例子
分享到: 更多 (0)

相关推荐

  • 暂无文章