ASP通过JMail组件读取邮件列表
|
admin
2010年7月3日 10:52
本文热度 6516
|
[p][br] [br]?? [br]
[br]?
[br]????? [br]????? 序号 | [br]????? 日期 | [br]????? 邮件标题 | [br]????? 发件人 | [br]????? 附件 | [br]????? 内容 | [br]???
[br]<%[br]if request.form("submit")<>"" then[br]pop3server=request.form("pop3server")[br]uid=request.form("uid")[br]upwd=request.form("upwd")[br]riqi=cdate(request.form("riqi"))[br]set pop3 = server.createobject( "jmail.pop3" )[br]pop3.connect uid, upwd, pop3server?? [br]'response.write( "你有" & pop3.count & " 封邮件。
" ) [br]'set msg=server.createobject("jmail.message")[br]function getattachments() '获得附件[br]?if attachments.count>0 then[br]?? set attachments = msg.attachments[br]??getattachments = attachments(0).name & "(" & attachments(0).size & " bytes)"[br]?else[br]?getattachments=""[br]?end if[br]? end function?? [/p]
[p]for i=1 to pop3.count[br]?set msg = pop3.messages.item(i)[br]?set attachments = msg.attachments[br]?if cdate(msg.date)>=riqi then%>[br]??? [br]????? <%= i %> | [br]????? <%= msg.date %> | [br]????? <%= msg.subject %> | [br]????? <%= msg.fromname %> | [br]????? <%= getattachments %> | [br]????? <%'=left(msg.body,50) %> | [br]???
[br]? <%end if[br]? next[br]? pop3.disconnect [br]end if%> [br]
[br]? [br]? [/p]
该文章在 2010/7/3 10:52:42 编辑过