I want to receive message body and the last received email or unseen emails in Swift 4. I search about it but every code in Objective-C or any other old languages. In Gmail, Yahoo, Outlook.
I received emails but I not successful to get the body of the message, and the last known message received.
var uidSet = MCOIndexSet(range: MCORangeMake(1, UINT64_MAX))
var fetchOp: MCOIMAPFetchMessagesOperation? = session.fetchMessagesByUIDOperation(withFolder: "INBOX", requestKind: MCOIMAPMessagesRequestKind.headers, uids: uidSet)
fetchOp?.start({ err, msgs, vanished in
//print(msgs)
let msgs = msgs as? [MCOIMAPMessage]
for msgs in msgs!{
I received all emails who are in my inbox but I want only unseen messages. And main problem is that I not successful to get the message body.