问题
I try use this class: MCOIMAPFetchContentOperation for fetch body mail. But i don't know how invoke her in swift and i don't know the arguments who are necessary.
Description of the class is: "This class implements an operation to fetch the content of a message. It can be a part or a full message."
Can you help me please !
回答1:
Your question is a little vague but I assume to mean something like this :
func loadMsg(msg: MCOIMAPMessage, folder: String) {
let operation: MCOIMAPFetchContentOperation = session.fetchMessageByUIDOperationWithFolder(folder, uid: msg.uid)
operation.start { (error:NSError!, data:NSData!) -> Void in
let messageParser: MCOMessageParser = MCOMessageParser(data: data)
let msgHTMLBody: NSString = messageParser.htmlBodyRendering()
print ("HTML: \(msgHTMLBody)")
}
}
来源:https://stackoverflow.com/questions/32589847/fetch-an-email-body-in-mailcore2-osx-with-swift