利用W3 JMAIL元件收POP3郵件 (轉)

gugu99發表於2008-01-11
利用W3 JMAIL元件收POP3郵件 (轉)[@more@]


dim startpage
dim endpage
startpage=int(request("start"))
endpage=int(request("end"))

  Set pop3 = Server.Create( "J.POP3" )

  uid=trim(request("uid"))
  pwd=trim(request("pwd"))
  pop=trim(request("pop"))
 
  if uid="" or pwd="" or pop="" then
  response.redirect "receiv."
  end if
 
 
  if uid<>"" and pwd<>"" and pop<>"" then
  response.("uid")=trim(request("uid"))
  response.cookies("pwd")=trim(request("pwd"))
  response.cookies("pop")=trim(request("pop"))
  else
  uid=request.cookies("uid")
  pwd=request.cookies("pwd")
  pop=request.cookies("pop")
  end if
  pop3.Connect uid, pwd,pop
 
  'pop3.Connect "agang0084", "921028", "pop3.sina.com.cn"
  response.write "

"
  Response.Write( "您的收件箱有 " & pop3.count & "

" )
  response.write "
"
 
 

  '計算頁數
  pagenum=10 '一頁共存幾條記錄
  if pop3.count  pagecount=1
  else
  intcount=int(pop3.count/pagenum)
  modcount=pop3.count mod pagenum
  if modcount>0 then
  pagecount=intcount+1 '如果總記錄除以一頁可存放的記錄數有餘數則頁數必須加以一
  else
  pagecount=intcount
  end if 
  end if
 
response.write ("您的郵件共有"&pagecount&"頁     ")
 
 
  '計算頁碼

  page=trim(request("page"))
  if page<>"" then
  case page
  case "firstpage"
  startpage=1
 endpage=pagenum
  case "lastpage"
  startpage=(pagecount-1)*pagenum+1
 endpage=pop3.count
  case "next"
  if endpage+10 > pop3.count then
  startpage=(pagecount-1)*pagenum+1
  endpage=pop3.count
 else
 startpage=startpage+10
 endpage=endpage+10
 end if  
  case "back"
  if startpage=pagenum+1 then
  startpage=1
  endpage=pagenum
 else
  startpage=startpage-10
  endpage=endpage-10
 end if
 end select
  else
  if pop3.count  startpage=1
  endpage=pop3.count
  else
  startpage=1
  endpage=pagenum
  end if
  end if 
 
 
 
  if pop3.count > 0 then
  dim msg(20)
  dim Attachments(20)
  for i=1 to pop3.count
 Set msg(i) = pop3.Messages.item(i)  
 Set Attachments(i) = msg(i).Attachments
 next
 %>
if startpage=1 then
response.write "第一頁     "
else
response.write "第一頁     "
end if

if endpage=pop3.count then
response.write "下一頁     "
else
response.write "下一頁     "
end if

if startpage=1 then
response.write "上一頁     "
else
response.write "上一頁     "
end if

if endpage=pop3.count then
response.write "最後一頁     "
else
response.write "最後一頁     "
end if

response.write "當前記錄是從第"
response.write startpage
response.write "封到"
response.write endpage
response.write "封的信件"
response.write "
"
response.write "
"
%>



 



 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
    %>
主題: 
 
 
發件人:     點選地址回覆信件
附件個數:     接收附件
正文: 
    

 
 
 
 

end if

  pop3.Dinnect

%>


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10748419/viewspace-997070/,如需轉載,請註明出處,否則將追究法律責任。

相關文章