当前位置:编程学习 > asp >>

利用W3 JMAIL组件收POP3邮件

<% @LANGUAGE=VBSCRIPT %>
<%
dim startpage
dim endpage
startpage=int(request("start"))
endpage=int(request("end"))
Set pop3 = Server.CreateObject( "JMail.POP3" )
uid=trim(request("uid"))
pwd=trim(request("pwd"))
pop=trim(request("pop"))

if uid="" or pwd="" or pop="" then
response.redirect "receivemail.asp"
end if


if uid<>"" and pwd<>"" and pop<>"" then
response.cookies("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 "<div align=center>"
Response.Write( "您的收件箱有 <font color=red>" & pop3.count & "</font> 封邮件<br><br>" )
response.write "</div>"


'计算页数
pagenum=10 '一页共存几条记录
if pop3.count<pagenum then
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"))
补充:asp教程,高级应用
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,