Fetch an email body in mailcore2 OSX with swift

一笑奈何 提交于 2019-12-12 03:58:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!