用ASP实现支持附件的EMail系统

2016-01-29 17:08 17 1 收藏

用ASP实现支持附件的EMail系统,用ASP实现支持附件的EMail系统

【 tulaoshi.com - ASP 】

    大家经常探讨使用asp,而不使用其他组建能否实现文件的上传,从而开发出支持邮件附件的邮件系统,答案是可以的。

  以下是发送邮件的页面,邮件的帐号是员工号,假设是5位的数字,sendmail.asp当然是在合法登陆后才能够看到的

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="/css/FORUM.CSS">
<style type=text/css>
<!--
input { font-size: 9pt; color: #0011dd; background-color: #e9e9f9; padding-top: 0px}
select { font-size: 9pt; color: #0011dd; background-color: #e9e9f9; padding-top: 0px}
textarea { font-size: 9pt; color: #0011dd; background-color: #e9e9f9; padding-top: 0px}
-->
</style>
<title>邮件系统</title></head>
<body bgcolor="#FEF7ED">
<script language="javascript">
<%
if session("myid")="" or len(session("myid"))<>5 then
response.write "window.open('nolog.asp',target='_top');"
end if
%>
function check(theform)
{

if (theform.geterempl.value=='')
{
alert('请输入收件人!');
theform.geterempl.focus();
return false;
}
if (theform.emailtitle.value=='')
{
alert('请输入主题!');
theform.emailtitle.focus();
return false;
}
if (theform.emailtitle.value.length>200)
{
alert('主题请少于200字节');
theform.emailtitle.focus();
return false;
}
if (theform.body.value.length>15*1024)
{
alert('正文请少于16K');
theform.body.focus();
return false;
}
if (theform.emailshowname.value.length>1024)
{
alert('签名请少于1K');
theform.emailshowname.focus();
return false;
}


}
</script>
<%
meth=request.querystring("meth")
if meth=1 then
geterempl=trim(request.querystring("geterempl"))
emailtitle=trim(request.querystring("emailtitle"))
elseif meth=2 then
mailid=trim(request.querystring("mailid"))
set conn=server.createobject("adodb.connection")
conn.open "DSN=;UID=;PWD="
dsnpath="DSN=;UID=;PWD="
set rs=server.createobject("adodb.recordset")


selectnew="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 selectnew,dsnpath,3,3
if rs.bof or rs.eof then
%>
<script language="javascript">
alert("您没有查看这封邮件的权限!");
window.history.back();
</script>
<%
response.end
else
body=rs("body")
emailtitle=rs("emailtitle")
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
end if
%>
<Form name="upload_file" onSubmit="return check(this)" action="loadmail.asp" method=post enctype="multipart/form-data" >
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="11%">
<div align="right">发件人:</div>
</td>
<td width="89%">
<input type="hidden" name="senderempl" value="<%=session("myid")%>">
<%=session("myid")%> </td>
</tr>
<tr>
<td width="11%">
<div align="right">收件人:</div>
</td>
<td width="89%">
<input type="text" name="geterempl" size="40" value="<%=geterempl%>">
<input type="checkbox" name="emaillevel" value="1" style="background-color: #FEF7ED">
紧急信件 </td>
</tr>
<tr>
<td width="11%" valign="top"> </td>
<td width="89%">发送多个人的时候可以使用"<font color="#9999FF">|</font>"隔开,例如:<font color="#3399FF">01234|01235|01236</font>,第一位和最后一位不需要"<font color="#9999FF">|</font>"

<font color="#FF0000">新功能</font>:您可以把信信直接发送给您设定的<a href="group.asp">某用户</a>,发送格式为:gr:组序号,例如<font color="#0099FF">gr:001</font></td>
</tr>
<tr>
<td width="11%">
<div align="right"></

来源:https://www.tulaoshi.com/n/20160129/1500428.html

延伸阅读
标签: ASP
  电子贺卡程序的数据库结构。(这仅代表我个人的在某一段时间的看法)。         表ECARD         贺卡的编号    ID            自动编号字段 贺卡的标题TITLE  ...
标签: ASP
  <% '***** BEGIN FUNCTION AREA ***** ' Formats a given 10 digit number into a nice looking phone number ' Example: given strNumber of 8005551212 you get (800) 555-1212 Function FormatPhoneNumber(strNumber) Dim strInput ' String to hold our entered number Dim strTemp ' Temporary string to hold our working tex...
标签: ASP
  编者(icech)按:这段程序的方法是利用XMLHTTP来读取腾讯网站的相应HTML代码获取QQ的头像,根据这个想法,我们还可以抓取很多其他网站的信息,如天气预报、新闻等等。 <script language="javascript" <!-- function getFaceImg(QQcode) { var Re=new RegExp("^[1-9]{1}\d+$","g"); if (!QQc...
标签: Web开发
传统的网页BBS大多是采用CGI模式实现的,它的实现要求编程者既要掌握编程语言如Perl或C等,又要了解关于CGI模式的各项技术内容,因此要制作自己的网页BBS确实困难不小。ASP(Active Server Pages 动态服务器主页)的出现,使我们眼前一亮,能不能利用ASP实现网页BBS呢?回答当然是肯定的。ASP的诱人之处就在于它提供了一种简单易学的脚本,并带...
标签: ASP
       <!-- #include file = "DB.fun" --<br>   <%<br>   mingcheng=request("mingcheng")<br>   sec=Request("score")<br>   session("mingcheng")=mingcheng<br>   session(&quo...