Is there any way I can read only last 1 hour mails in gmail.(Urgent)

You can do something like this

mailDate = cDate(item.Headers("Date")) where item is a mailMessage

This will give you the date of the email, then you can use if condition and write something like this

if (mailDate < DateTime.Now AND mailDate > DateTime.Now.AddHours(-1))
{ then do your stuff}

Working fine at my end

Thanks,
Prankur

2 Likes