上一篇:常用Email组件发送函数 >>
使用asp实现支持附件的邮件系统(三)
<%
Response.Buffer= true
Response.Clear
function getname(oriname)
thename=oriname
do while instr(thename,"/")>0
thename=mid(thename,instr(thename,"/")+1)
loop
do while instr(thename,"\")>0
thename=mid(thename,instr(thename,"\")+1)
loop
getname=thename
end function
function canexec(thechar)
if instr(thechar,".asp")>0 then
canexec=false
exit function
end if
if instr(thechar,".asa")>0 then
canexec=false
exit function
end if
if instr(thechar,".aspx")>0 then
canexec=false
exit function
end if
if instr(thechar,".asax")>0 then
canexec=false
exit function
end if
canexec=true
end function
mailID=request("mailID")
se=request("se")
if se<>1 and se<>2 and se<>3 then
response.end
end if
Set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
conn.open "DSN=;UID=;PWD="
sql="select * from t_mail where ((geterempl like @#%"&session("myid")&"%@# or deleempl like @#%"&session("myid")&"%@# or receempl like @#%"&session("myid")&"%@# ) and (not deleverempl like @#%"&session("myid")&"%@#)) and mailid=@#"&mailid&"@# "
rs.open sql,conn,3,3
if rs.eof or rs.bof then
response.end
end if
if rs("filecontenttype_"&trim(se))<>"text/plain" or (not canexec(getname(trim(rs("filename_"&trim(se)))))) then
Response.ContentType = rs("FileContentType_"&trim(se))
end if
@#Response.AddHeader "content-type","application/x-msdownload"
if instr(response.contenttype,"application")>0 then
response.AddHeader "Content-Disposition","attachment;filename="&getname(trim(rs("filename_"&trim(se))))
end if
Response.BinaryWrite rs("FileContent_"&trim(se))
rs.close
set rs=Nothing
conn.close
set conn=nothing
%>
文章到这里就结束了,至于邮件数据库的数据结构大家根据代码自己琢磨吧!
下一篇:使用asp实现支持附件的邮件系统(二) >>
相关文章:
- · IMail基础教程(四) 用POP3方式收发邮件
- · IMail基础教程(三) 建立可用的电子邮件地址
- · IMail基础教程(二) 安装IMail
- · IMail基础教程(一) DNS设置 - 2
- · IMail基础教程(一) DNS设置 - 1
- · 邮件服务器端软件-IMAIL基础教程
- · 用ASPMail组件实现E_mail自动反馈
- · jmail4.1用pop3收信的例子
- · 用ASP发送HTML格式的邮件
- · 在Windows桌面上使用WSH接收邮件
- · 如何在ASP+中发送邮件
- · asp电子报制作与程序
- · 如何使用FSO搜索硬盘文件
- · 使用函数自动生成n层目录
- · FSO操作示例(给初学者)
- · 同文件夹内文本搜索器(vbs)
- · 一个实用的FSO-实时统计在线人数
- · 如何获知页面上的图象的实际尺寸?
- · 使用FSO把文本信息导入数据库
- · 在ASP中使用FSO组件生成HTML页面
- · 用asp实现的代码批量修改程序,fso相关
- · fso实例
- · 硬盘文件搜索代码(ASP类)
- · 遍历目录以及目录下文件的函数
- · vithink小文件自动实现文件浏览下载
- · 用asp实现的代码批量修改程序,fso相关
- · fso实例
- · 使用FSO把文本信息导入数据库
- · 在线实时开通FTP&WEB
- · 对文件的操作--建立移动删除文件夹
- · 一个实用的FSO-实时统计在线人数
- · 利用FSO取得BMP,JPG,PNG,GIF文件信息
- · 三种禁用FileSystemObject组件的方法
- · 遍历目录以及目录下文件的函数
- · 在线修改Serv-U 4.2用户密码
- · asp 中常用的文件处理函数
- · 使用FSO把文本信息导入数据库
- · FSO+递归生成文件列表(xml)
