使用asp實(shí)現(xiàn)支持附件的郵件系統(tǒng):大家經(jīng)常探討使用asp,而不使用其他組建能否實(shí)現(xiàn)文件的上傳,從而開發(fā)出支持郵件附件的郵件系統(tǒng),答案是可以的。請看: 以下是發(fā)送郵件的頁面,郵件的帳號(hào)是員工號(hào),假設(shè)是5位的數(shù)字,sendmail.asp當(dāng)然是在合法登陸后才能夠看到的 郵件系統(tǒng) < script language="java script "> <% 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字節(jié)'); 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="java script "> alert("您沒有查看這封郵件的權(quán)限!"); 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 %>