(Go) Transition from Imap.FetchSequenceAsMime to Imap.FetchSingleBd
Provides instructions for replacing deprecated FetchSequenceAsMime method calls with FetchSingleBd. Note: This example requires Chilkat v11.0.0 or greater.
imap := Imap_Ref.html">chilkat.NewImap()
// ...
// ...
startSeqNum := 1
count := 5
// ------------------------------------------------------------------------
// The FetchSequenceAsMime method is deprecated:
sa := imap.FetchSequenceAsMime(startSeqNum,count)
if imap.LastMethodSuccess() == false {
fmt.Println(imap.LastErrorText())
imap.DisposeImap()
return
}
// ...
// ...
sa.DisposeStringArray()
// ------------------------------------------------------------------------
// Do the equivalent using FetchSingleBd.
imap.SetAutoDownloadAttachments(true)
success := false
bdMime := BinData_Ref.html">chilkat.NewBinData()
bUid := false
i := 0
for i < count {
success = imap.FetchSingleBd(startSeqNum + i,bUid,bdMime)
// ...
// ...
i = i + 1
}
imap.DisposeImap()
bdMime.DisposeBinData()
|