Why not use
<cfoutput>
<cfloop from="#mailhead.recordcount#" to="#mailhead.recordcount# - 5"
step="-1" index="i">
#mailhead.from[i]# #mailhead.subject[i]#
</cfloop>
</cfoutput>
Off top of my head. Can't remember if the array syntax is right though!
Paul
PS It may be quicker to go right down to the tcp request level if you want
more speed. This can be done by sending requests to the pop server like;
user <username>
pass <pass>
This will then return (in some text) the number of messages (lets say "x").
Then retrieve only those headers with
top x
top x-1
top x-2
top x-3
top x-4
This will return five headers to you. Play with them in CF, and you don't
have to download all of them!
You can then do anything you want with them. Delete them read them blah
blah blah!
> -----Original Message-----
> From: Suhail Khaki [mailto:[EMAIL PROTECTED]]
> Sent: 11 October 2000 10:37
> To: CF-Talk
> Subject: CFPOP and WAP!!!!!1
>
>
> hi ..
> I am trying to make a WAP based email client using
> coldfusion.My problem is that i want the latest
> messages in my inbox of pop account to be displayed at
> the top.Though i think of doing it in a way but i feel
> it as adhoc n not a good way.What i intend to do is
> first retrieving all mail headers, rocording its
> count,
> then diaplaying these headers using CFLOOP (over
> query).. but this way i can get the latest mails n not
> the latest one on the top...(hope u r getting what i
> mean...(code is below).
> ONe more query i am having is that
> "IS THERE A WAY TO KNOW JUST THE UNREAD MESSAGES IN UR
> POP MAIL?????".
> Since the memory is very less for wap based devices,
> it
> becomes necessarry to optimize the code n speed.
> Any help will be appreciated...
> Also specially thanking to JAMMIE and DAVE for
> responding my earlier mail...:).
>
> ####################
> <CFCONTENT type="text/vnd.wap.wml">
> <CFPOP server="mail.sever.net" username="#uname#"
> password="#pword#" action="GetHeaderOnly"
> name="mailhead" timeout="180">
> <?xml version="1.0"?>
> <!DOCTYPE wml public "-//PHONE.COM//DTD WML 1.1//EN"
> "http://www.phone.com/dtd/wml11.dtd">
> <WML>
> <CARD id="headercd" title="headers">
> <P>
> <CFOUTPUT>
> <CFLOOP query="mailhead"
> startrow="#mailhead.recordcount# -5"
> endrow="#mailhead.recordcount#">
> #mailhead.from# #mailhead.subject#
> </CFLOOP>
> </CFOUTPUT>
> </P></CARD></WML>
> ########################################
>
>
> __________________________________________________
> Do You Yahoo!?
> Get Yahoo! Mail - Free email you can access from anywhere!
> http://mail.yahoo.com/
> ------------------------------------------------------------------
> ------------
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
_talk or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.