首 页 | 精品电影 | 音乐天堂 | 在线游戏 | Flash MTV | 三湘书屋 | 幽默笑话 | 三湘图库 | 美女写真 | IT知识库 | QQ贴图 | 加入书签

网页制作网络编程图形图象操作系统冲浪宝典软件教学网络安全认证考试通信技术电子商务业内动态书籍教程原码

最近更新 文章分类 多媒体类 精品软件

本站搜索:
您的位置:三湘时空 -> IT知识库 -> 文章分类 -> 邮件服务器 -> 使用asp实现支持附件的邮件系统(三)
使用asp实现支持附件的邮件系统(三)


文章类别:邮件服务器 来源: 作者: 发表日期:2006-12-7 字体:[ ]

小游戏 | 在线影院 | 幽默笑话 | 源码下载 | Flash MTV | 音乐试听 | 书屋 | 美女写真

最后,我们来讲讲如何把内容从数据库中读出来,内容有这么几类,一类是浏览器上可以显示的,例如*.htm,一类是需要下载的,例如*.exe,还有一种是浏览器可以显示但是不能够让他显示的,例如*.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 '%"%26amp;session("myid")%26amp;"%' or deleempl like '%"%26amp;session("myid")%26amp;"%' or receempl like '%"%26amp;session("myid")%26amp;"%' ) and (not deleverempl like '%"%26amp;session("myid")%26amp;"%')) and mailid='"%26amp;mailid%26amp;"' "
rs.open sql,conn,3,3
if rs.eof or rs.bof then
response.end
end if
if rs("filecontenttype_"%26amp;trim(se))<>"text/plain" or (not canexec(getname(trim(rs("filename_"%26amp;trim(se)))))) then
Response.ContentType = rs("FileContentType_"%26amp;trim(se))
end if



'Response.AddHeader "content-type","application/x-msdownload"

if instr(response.contenttype,"application")>0 then
response.AddHeader "Content-Disposition","attachment;filename="%26amp;getname(trim(rs("filename_"%26amp;trim(se))))
end if
Response.BinaryWrite rs("FileContent_"%26amp;trim(se))
rs.close
set rs=Nothing
conn.close
set conn=nothing
%>

文章到这里就结束了,至于邮件数据库的数据结构大家根据代码自己琢磨吧!
上一篇:通过ASP发送带附件的HTML格式邮件例程可以带附件 下一篇:使用asp实现支持附件的邮件系统(一)
本栏目热门文章
·巧妙配置Win2003自带mail服务器 2006-12-7
·WINWEBMAIL应用CBL列表 2006-12-7
·Windows Server 2003也能提供邮件服务 2006-12-8
·打造一个小巧的邮件服务器 2006-12-7
·中小企业轻松架设E-mail服务器 2006-12-7
·iPlanet Messaging Server 安装图解 2006-12-7
·用Visual C#实现xx邮件接收程序 2006-12-8
·XMAIL的安装及配置 2006-12-7
·近日研究xmail邮件服务器心得 2006-12-7
·如何利用ASP实现邮箱访问 2006-12-7
新近更新文章
·用WebEasyMail架构邮件服务器 2006-12-8
·利用twig架设WebMail系统 2006-12-8
·如何安装一个hotmail的邮箱系统 2006-12-8
·用Foxmail Server搭建邮件服务器 2006-12-8
·Merak 5.94完全上手 2006-12-8
·WebEasyMail 问题解答大全 2006-12-8
·VisNetic MailServer简易安装指南 2006-12-8
·James安装使用简易指南 2006-12-8
·VisNetic MailServer 常见问题 2006-12-8
·Easymail邮件服务端设置全攻略 2006-12-8
首 页 | 软件发布 | 广告联系 | 下载帮助 | 意见反馈 | 网站地图
  CopyRight? 2002-2004 WWW.SXSKY.NET? All Rights Reserved
三湘时空 站长QQ:82675303 Email: