我不知道在哪里查看參考資料以完成此操作;我已經嘗試了幾次代碼迭代,每次都失敗了。略有編輯,但足以了解要點......// Make connectionimConnection, err := imap.DialTLS(strAddress, nil)// Defer disconnectdefer func(){ imConnection.Logout(30*time.Second)}// AuthenticateimConnection.Login(strUname, strPass)//Select the folder with messages I want to moveimConnection.Select(`[Gmail]\Movethese`, false)// Create a setset, _ = imap.NewSeqSet("1:*")// It's my understanding that moving messages means copying them over, then// deleting the original messages?cmd, _ := imConnection.UIDCopy(set, `[Gmail]\Destination`)這似乎無聲無息地失敗了。在我看來,它應該選擇“Movethese”文件夾中的所有內容并將它們復制到“Destination”。我在正確復制它們時缺少什么?是否有一種簡單的方法可以移動與特定主題行字符串匹配的單個消息?此外,我不確定在選擇時是否必須將源目錄的 R/W 設置為 False,但這似乎沒有什么區別。這是導入github.com/mxk/go-imap/imap 包
- 1 回答
- 0 關注
- 208 瀏覽
添加回答
舉報
0/150
提交
取消