[英]How to mark a message as read , \Seen on IMAP ( Go )
您必须选择可写邮箱
youImapConnection.Select(mailboxName, false) // true would be for readonly
然后只需执行以下操作
seq, _ := imap.NewSeqSet("")
err := seq.AddNum(612) // 612 is your UID
_, err = imap.Wait(youImapConnection.UIDStore(seq, "+FLAGS", imap.NewFlagSet(`\Seen`))) // Here you tell to add the flag \Seen
最后,您必须清除:
_, err := imap.Wait(youImapConnection.Close(true)) // Here you tell to apply changes, necessary if you mark an Email as deleted
而且你应该很好:-)
并且不要犹豫地浏览文档/源代码,这很容易理解,您将找到所需的一切。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.