Sample code for 30+ languages & platforms
Go

Transition from Imap.FetchSequenceAsMime to Imap.FetchSingleBd

Provides instructions for replacing deprecated FetchSequenceAsMime method calls with FetchSingleBd.

Chilkat Go Downloads

Go
    success := false

    imap := 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 := chilkat.NewBinData()
    bUid := false
    i := 0
    for i < count {
        success = imap.FetchSingleBd(startSeqNum + i,bUid,bdMime)
        // ...
        // ...

        i = i + 1
    }


    imap.DisposeImap()
    bdMime.DisposeBinData()