Closed chaurasiawadh closed 3 years ago
let folder : String = "[Gmail]/All Mail" let folderInfo = retSession.folderInfoOperation(folder)
folderInfo?.start({ error, info in let messageCount = info?.messageCount ?? 0 let messageCountData = UInt64(messageCount)
var latest = 100
var lowerbound = messageCount
let uidset = MCOIndexSet(range: MCORangeMake(UInt64(lowerbound) - UInt64(latest), UInt64(latest)))
let fetchOperation = retSession.fetchMessagesByNumberOperation(
withFolder: folder,
requestKind: MCOIMAPMessagesRequestKind.fullHeaders,
numbers: uidset)
})
@chaurasiawadh IMAP server does not provide any func to retrieve this kind of data, you must combine message count and next UID to construct the MailCore operation parameter for your purpose.
I have 25 Lakh mails in my Gmail account but I want only the latest 7 days message or latest 100 mails only. How can I do it?
function getMails
I want only 100 mails to get:
But it's not working