Search The ForumSearch   RegisterRegister  LoginLogin

MailBee IMAP4

 AfterLogic Forum : MailBee IMAP4
Subject Topic: How to list new messages first Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
XAvinashX
Newbie
Newbie


Joined: 17 April 2007
Location: United States
Online Status: Offline
Posts: 7
Posted: 17 April 2007 at 9:01pm | IP Logged Quote XAvinashX

Can someone guide me how to list new messages first. And also change the date format in mm/dd/yy in ASP.

It will be of big help, i have gone over my head trying to figure this 2 things.

I would greatly appreciate an sample asp script for both problems.

Thanx
Back to Top View XAvinashX's Profile Search for other posts by XAvinashX
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 18 April 2007 at 3:47am | IP Logged Quote Andrew

You can retrieve all messages via IMAP4.RetrieveEnvelopes method and then resort messages in your application according to Envelope.Flags property. In contrast to new messages, old ones have Seen flag set.

Another way is to retrieve new messages (which haven't Seen flag set) and then old ones. This described in "Search for new messages" sample of MailBee Objects documentation.

You can change date format to US as follows:
Code:
SetLocale("en-us")

Dim myDate, myString

myDate = Now

myString = FormatDateTime(myDate, 2)



Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
XAvinashX
Newbie
Newbie


Joined: 17 April 2007
Location: United States
Online Status: Offline
Posts: 7
Posted: 18 April 2007 at 9:12pm | IP Logged Quote XAvinashX

SetLocale("en-us")

Dim myDate, myString

myDate = objEnvelopes(I).Date

myString = FormatDateTime(myDate, 2)

<%= myString %>

I am trying this but its not working ????
Back to Top View XAvinashX's Profile Search for other posts by XAvinashX
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 19 April 2007 at 3:14am | IP Logged Quote Andrew

FormatDateTime function requires the first parameter to be of Date type, but objEnvelopes(I).Date is of String type. To convert a string which contains a date to Date type, you should use Message.GetDateFromString method as follows:

Code:
SetLocale("en-us")

Dim myDate, myString, msg

Set Msg = CreateObject("MailBee.Message")

myDate = msg.GetDateFromString(objEnvelopes(I).Date, False)

myString = FormatDateTime(myDate, 2)

<%= myString %>




Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
XAvinashX
Newbie
Newbie


Joined: 17 April 2007
Location: United States
Online Status: Offline
Posts: 7
Posted: 20 April 2007 at 7:31am | IP Logged Quote XAvinashX

Thank you soooo muchhhh, it works it works finally the date function is resolved!!! I am still working on the search part and the list new messages first part.

thank you sir
Back to Top View XAvinashX's Profile Search for other posts by XAvinashX
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide