用EasyMailObject组件处理Exchange邮件源代码(3)

桑索南达杰

桑索南达杰

2016-01-29 17:39

用EasyMailObject组件处理Exchange邮件源代码(3),用EasyMailObject组件处理Exchange邮件源代码(3)
  在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:webmailmailatt"
   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/wwwrootmailatt"+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
   %
 
展开更多 50%)
分享

猜你喜欢

用EasyMailObject组件处理Exchange邮件源代码(3)

ASP
用EasyMailObject组件处理Exchange邮件源代码(3)

用EasyMailObject组件处理Exchange邮件源代码(6)

ASP
用EasyMailObject组件处理Exchange邮件源代码(6)

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

用EasyMailObject组件处理Exchange邮件源代码(2)

ASP
用EasyMailObject组件处理Exchange邮件源代码(2)

用EasyMailObject组件处理Exchange邮件源代码(1)

ASP
用EasyMailObject组件处理Exchange邮件源代码(1)

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

用EasyMailObject组件处理Exchange邮件源代码(4)

ASP
用EasyMailObject组件处理Exchange邮件源代码(4)

用EasyMailObject组件处理Exchange邮件源代码(5)

ASP
用EasyMailObject组件处理Exchange邮件源代码(5)

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

Linux系统GRUB引导单用户模式三种方式

Linux系统GRUB引导单用户模式三种方式

配置好显卡驱动Linux下玩游戏同样爽

配置好显卡驱动Linux下玩游戏同样爽
下拉加载更多内容 ↓