ASP实现不存在的网页就自动发送邮件(jmail组件发送)
来源:互联网 发布:xcode编程c语言 编辑:程序博客网 时间:2024/05/21 08:51
使用jmail组件发送邮件: 制作网站的时候通常会有当访客的一些错误操作或我们网站本身的缺陷,造成某个不存在的页面被访问,这时会出现404错误提示信息,如果是热心的访客可能会给你发一封邮件提示你,当时大部分时候是访客不会给我们发邮件的。用ASP做一个实用的程序,当用户访问出现404错误提示信息的时候系统会自动发一封邮件给我们,这样就不必担心了,制作代码如下:
以下是引用片段:
<% @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 = ""
objSMTP.FromName = "Your Domain"
objSMTP.Subject = "404 Error Logged"
objSMTP.AddRecipient("")
' Write the message http://www.361du.net
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>
- ASP实现不存在的网页就自动发送邮件(jmail组件发送)
- JMail组件发送邮件的Asp代码
- ASP JMail组件发送邮件
- Jmail组件发送邮件
- 在asp中用jmail组件发送邮件
- ASP.NET邮件发送,jmail组件
- VB6, ASP 通用的 用Jmail组件发送邮件
- asp+jmail发送邮件
- asp Jmail发送邮件
- asp+JMAIL发送邮件
- asp Jmail发送邮件
- ASP+JMAIL发送邮件
- 如何使用JMAIL组件实现邮件的发送与接收
- Jmail实现邮件发送
- Jmail组件发送邮件失败的原因
- asp+jmail邮件发送功能的实现,解决乱码
- ASP的JMail邮件发送代码与JMail组件的下载
- ASP利用Jmail发送邮件的问题
- 自动填充如何设置
- sql防注入防范sql注入式攻击js版本
- ASP使用正则表达式获得代码中第一张图片地址
- ASP脚本语言的19个基本技巧应用
- android studio 使用.so文件 配置过程
- ASP实现不存在的网页就自动发送邮件(jmail组件发送)
- ASP网站Server object error的解决办法
- ASP接收Ajax 在POST方式下发送的escape编码中的个别乱码
- rs.open与conn.execute参数详细解释
- sql server日期比较日期查询常用语句
- 熟练掌握ASP分页技术
- 一般情况下,网站的图片代码是这样的。
- 操作系统5-设备的驱动
- ASP的时间处理函数