• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    使用asp實現支持附件的郵件系統(一)

    發布: 2007-7-14 19:37 | 作者: 佚名    | 來源: 網絡轉載     | 查看: 11次 | 進入軟件測試論壇討論

    領測軟件測試網 大家經常探討使用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>"<br>
    <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"></div>
    </td>
    <td width="89%">
    <input type="checkbox" name="receempl" value="1" style="background-color: #FEF7ED">
    保存一份到收藏夾[<font color="#3399FF">選定此項,則郵件發送到對方郵箱的同時發送到自己的收藏夾里</font>]</td>
    </tr>
    <tr>
    <td width="11%" valign="top"> </td>
    <td width="89%"> </td>
    </tr>
    <tr>
    <td width="11%" align="right"> 主題:</td>
    <td width="89%">
    <input type="text" name="emailtitle" size="60" value="<%=emailtitle%>">
    </td>
    </tr>
    <tr>
    <td width="11%" valign="top">
    <div align="right">正文:</div>
    </td>
    <td width="89%">
    <TEXTAREA name=body rows=8 cols=60><%=body%></TEXTAREA>
    </td>
    </tr>
    <tr>
    <td width="11%" valign="top">
    <div align="right">簽名:</div>
    </td>
    <td width="89%">
    <textarea name="emailshowname" cols="30" rows="6"><%=application(session("myid")&"_name")%></textarea>
    </td>
    </tr>
    <tr>
    <td width="11%">
    <div align="right">
    <input type=hidden name="FileUploadStart">
    附件1: </div>
    </td>
    <td width="89%">
    <input type="file" name="file_up" size="50">
    </td>
    </tr>
    <tr>
    <td width="11%">
    <div align="right">附件2:</div>
    </td>
    <td width="89%">
    <input type="file" name="file_up1" size="50">
    </td>
    </tr>
    <tr>
    <td width="11%">
    <div align="right">附件3:</div>
    </td>
    <td width="89%">
    <input type="file" name="file_up2" size="50">
    <input type=hidden name="FileUploadEnd">
    </td>
    </tr>
    <tr>
    <td width="11%">
    <div align="right"></div>
    </td>
    <td width="89%">
    <input type=submit value=確定 >
    </td>
    </tr>
    </table>
    </Form>
    </body>
    </html>


    文章來源于領測軟件測試網 http://www.kjueaiud.com/


    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備2023014753號-2
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>