ASP實(shí)現(xiàn)不存在的網(wǎng)頁(yè)就自動(dòng)發(fā)送郵件_ASP教程
推薦:用ASP編寫更人性化的彈出窗口程序ASP實(shí)例:用ASP編寫更人性化的彈出窗口程序,來(lái)幫我們制作一個(gè)不煩人的調(diào)查的方法。 用彈出窗口來(lái)顯示調(diào)查表,被認(rèn)為是達(dá)到我們收集訪問(wèn)用戶信息的最方便快捷的方法。當(dāng)制作出第一份調(diào)查表后
我們?cè)谥谱骶W(wǎng)站的時(shí)候,通常會(huì)有當(dāng)訪客的一些錯(cuò)誤操作或我們網(wǎng)站本身的缺陷,造成某個(gè)不存在的頁(yè)面被訪問(wèn),這時(shí)會(huì)出現(xiàn)404錯(cuò)誤提示信息,如果是熱心的訪客可能會(huì)給你發(fā)一封郵件提示你,當(dāng)時(shí)大部分時(shí)候是訪客不會(huì)給我們發(fā)郵件的。今天給大家介紹的這個(gè)程序是當(dāng)我們的網(wǎng)站出現(xiàn)404錯(cuò)誤提示時(shí)自動(dòng)發(fā)送一封郵件給我們,代碼如下:
| 以下為引用的內(nèi)容: <% @language="vbscript" %> <% Option Explicit %> <% Dim strPage, strReferer, strMessage Dim objSMTP ' Log the offending page strPage = Request.ServerVariables("HTTP_URL") ' Log the referer strReferer = Request.ServerVariables("HTTP_REFERER") ' Set up the email component Set objSMTP = Server.CreateObject("JMail.Message") objSMTP.From = "[email protected]" objSMTP.FromName = "Your Domain" objSMTP.Subject = "404 Error Logged" objSMTP.AddRecipient("[email protected]") ' Write the message strMessage = "Requested page: " & strPage & vbCrLf & vbCrLf If strReferer <> "" Then strMessage = strMessage & "Referer: " & strReferer Else strMessage = strMessage "The visitor typed the address in" End If objSMTP.Body = strMessage ' Send the message objSMTP.Send("mail.jzxue.com") ' Tidy up objSMTP.ClearRecipients objSMTP.Close() Set objSMTP = Nothing %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>404 Page Not Found</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <body> <h1>404 Page Not Found Error</h1> <p> Appropriate message here. </p> </body> </html> <% @language="vbscript" %> <% Option Explicit %> <% Dim strPage, strReferer, strMessage Dim objSMTP ' Log the offending page strPage = Request.ServerVariables("HTTP_URL") ' Log the referer strReferer = Request.ServerVariables("HTTP_REFERER") ' Set up the email component Set objSMTP = Server.CreateObject("JMail.Message") objSMTP.From = "[email protected]" objSMTP.FromName = "Your Domain" objSMTP.Subject = "404 Error Logged" objSMTP.AddRecipient("[email protected]") ' Write the message strMessage = "Requested page: " & strPage & vbCrLf & vbCrLf If strReferer <> "" Then strMessage = strMessage & "Referer: " & strReferer Else strMessage = strMessage "The visitor typed the address in" End If objSMTP.Body = strMessage ' Send the message objSMTP.Send("mail.jzxue.com") ' Tidy up objSMTP.ClearRecipients objSMTP.Close() Set objSMTP = Nothing %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>404 Page Not Found</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <body> <h1>404 Page Not Found Error</h1> <p> Appropriate message here. </p> </body> </html> |
請(qǐng)作者聯(lián)系本站,及時(shí)附注您的姓名。聯(lián)系郵箱:mb5u#vip.qq.com(把#改為@)。
分享:初學(xué)者的ASP教程:常用ASP內(nèi)置函數(shù)函數(shù),就是該語(yǔ)言封裝了的一個(gè)功能塊,以方便用戶的調(diào)用。比如“now()”在VBScript中就是一個(gè)能顯示出當(dāng)前日期和時(shí)間的函數(shù)。至于具體為什么能顯示,則是該語(yǔ)言內(nèi)核所定的,用戶只需
- asp FSO 讀寫文件本文件實(shí)現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實(shí)IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫(kù)實(shí)現(xiàn)代碼
- asp中正則表達(dá)式過(guò)濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁(yè)模板:ASP內(nèi)建對(duì)象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個(gè)小技巧
- eWebEditor v3.8 列目錄
- ASP無(wú)組件分頁(yè)實(shí)現(xiàn)思路及代碼
- 相關(guān)鏈接:
復(fù)制本頁(yè)鏈接| 搜索ASP實(shí)現(xiàn)不存在的網(wǎng)頁(yè)就自動(dòng)發(fā)送郵件
- 教程說(shuō)明:
ASP教程-ASP實(shí)現(xiàn)不存在的網(wǎng)頁(yè)就自動(dòng)發(fā)送郵件
。