Sample code for 30+ languages & platforms
Go

Transition from MailMan.FetchMultiple to MailMan.FetchUidlSet

Provides instructions for replacing deprecated FetchMultiple method calls with FetchUidlSet.

Chilkat Go Downloads

Go
    success := false

    mailman := chilkat.NewMailMan()

    // ...
    // ...

    saUidls := chilkat.NewStringArray()
    saUidls.Append("aaa")
    saUidls.Append("bbb")
    saUidls.Append("ccc")

    stUidls := chilkat.NewStringTable()
    stUidls.Append("aaa")
    stUidls.Append("bbb")
    stUidls.Append("ccc")

    // ------------------------------------------------------------------------
    // The FetchMultiple method is deprecated:

    bundleObj := mailman.FetchMultiple(saUidls)
    if mailman.LastMethodSuccess() == false {
        fmt.Println(mailman.LastErrorText())
        mailman.DisposeMailMan()
        saUidls.DisposeStringArray()
        stUidls.DisposeStringTable()
        return
    }

    // ...
    // ...

    bundleObj.DisposeEmailBundle()

    // ------------------------------------------------------------------------
    // Do the equivalent using FetchUidlSet.
    // Your application creates a new, empty EmailBundle object which is passed 
    // in the last argument and filled upon success.

    headersOnly := false
    // Irrelevant because we are not downloading headers-only.
    numBodyLines := 0

    bundleOut := chilkat.NewEmailBundle()
    success = mailman.FetchUidlSet(stUidls,headersOnly,numBodyLines,bundleOut)
    if success == false {
        fmt.Println(mailman.LastErrorText())
        mailman.DisposeMailMan()
        saUidls.DisposeStringArray()
        stUidls.DisposeStringTable()
        bundleOut.DisposeEmailBundle()
        return
    }


    mailman.DisposeMailMan()
    saUidls.DisposeStringArray()
    stUidls.DisposeStringTable()
    bundleOut.DisposeEmailBundle()