<em id="hanht"></em>

    <dd id="hanht"></dd>

    <em id="hanht"><acronym id="hanht"></acronym></em>
    
    <button id="hanht"></button>
    <rp id="hanht"><object id="hanht"><blockquote id="hanht"></blockquote></object></rp><em id="hanht"></em>

    首頁 > 開發 > Asp > 正文

    用EasyMailObject組件處理Exchange郵件源代碼(3)

    2018-10-16 21:07:02
    字體:
    來源:轉載
    供稿:網友
    在ASP中用EasyMailObject組件處理Exchange郵件源代碼---保存附件(saveatt.asp)

    <%@ Language=VBscript %>
    <%
    '*************************************

    '這個文件用來下載附件
    '作者:awayeah
    '郵箱:awayeah@163.net

    '*************************************


    Dim fso, tempfile
    Set fso = CreateObject("scripting.FileSystemObject")
       Dim tfolder, tname, tfile
    '   Const TemporaryFolder = 2
    '   Set tfolder = fso.GetSpecialFolder(TemporaryFolder)
    set POP3=session("pop3")

    '   Set POP3 = CreateObject("EasyMail.POP3.5")
    '   POP3.LicenseKey = "awa/S19I500R1AX30C0R3100"
    '   POP3.MailServer = strServer
    '   POP3.Account = session("straccount")
    '   POP3.Password = session("strpassword")
    '   pop3.PreferredBodyFormat=1
    '   pop3.TimeOut=90
       x = POP3.Connect()
       If x <> 0 Then
          Response.Write "連接錯誤: " + CStr(x)
          POP3.Disconnect
       End If

    '設定附件存放的臨時目錄,要用絕對路徑,這個目錄應賦足夠的權限給IUSR_HOST帳戶,并且已經WEB共享
       pop3.TempDirectory="e:/webmail/mailatt"
       y = POP3.DownloadHeaders
       i=clng(request.querystring("msgid"))
       j=clng(request.querystring("attid"))
       msg = POP3.DownloadSingleMessage(i)
       'Set Message Object to point to that downloaded message
       Set Message = POP3.Messages(msg)
       'Message.Attachments(j).save tfolder+"/"+Message.Attachments(j).filename,1
       'Message.Attachments(j).save "c:/inetpub//wwwroot/mailatt/"+Message.Attachments(j).filename,1
       'Response.write "file:///"+"/mailatt/"+Message.Attachments(j).filename
       pathname=Message.Attachments(j).TempFileName
       parentfolder=fso.GetParentFolderName(pathname)
       set folder=fso.GetFolder(parentfolder)
       dir_name=folder.name
       filename=fso.GetFileName(pathname)
       path="/webmail/mailatt/"+dir_name+"/"+filename
       Response.Redirect path
       %>
    發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表

    圖片精選

    一级特黄大片欧美久久久久_一本一道久久综合狠狠老_JLZZ日本人年轻护士_欧美男男作爱VIDEOS可播放
      <em id="hanht"></em>

      <dd id="hanht"></dd>

      <em id="hanht"><acronym id="hanht"></acronym></em>
      
      <button id="hanht"></button>
      <rp id="hanht"><object id="hanht"><blockquote id="hanht"></blockquote></object></rp><em id="hanht"></em>