MailCore how to delete a message

旧城冷巷雨未停 提交于 2020-01-03 06:26:10

问题


When using MailCore, how do I go about deleting a message? I understand that I set an IMAP deleted flag for a CTCoreMessage but does that actually cause a message to be deleted by the server? Or is there another way to do this?


回答1:


First use:

- (BOOL)setFlags:(NSUInteger)flags forMessage:(CTCoreMessage *)msg;

to set the deleted flag

then:

 - (BOOL)expunge;

These are both methods in CTCoreFolder.

The tricky part comes from determining if the account is GMail and if the user would rather the message gets moved to [GMail]/Trash or actually deleted




回答2:


I don't know the library you're using, but no, setting the \Deleted flag does not delete the message right away. You will need to use either the EXPUNGE (usually this is used) or the CLOSE command to do so (after setting the \Deleted flag). Refer to RFC3501 for further details about these commands.



来源:https://stackoverflow.com/questions/16351947/mailcore-how-to-delete-a-message

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