Sample code for 30+ languages & platforms
Go Requires Chilkat v11.0.0+

Transition from MailMan.FetchSingleHeaderByUidl to MailMan.FetchByUidl

Provides instructions for replacing deprecated FetchSingleHeaderByUidl method calls with FetchByUidl.

Chilkat Go Downloads

Go
    success := false

    mailman := chilkat.NewMailMan()

    //  ...
    //  ...

    numBodyLines := 5
    uidl := "123"

    //  ------------------------------------------------------------------------
    //  The FetchSingleHeaderByUidl method is deprecated:

    emailObj := mailman.FetchSingleHeaderByUidl(numBodyLines,uidl)
    if mailman.LastMethodSuccess() == false {
        fmt.Println(mailman.LastErrorText())
        mailman.DisposeMailMan()
        return
    }

    //  ...
    //  ...

    emailObj.DisposeEmail()

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

    headerOnly := true

    emailOut := chilkat.NewEmail()
    success = mailman.FetchByUidl(uidl,headerOnly,numBodyLines,emailOut)
    if success == false {
        fmt.Println(mailman.LastErrorText())
        mailman.DisposeMailMan()
        emailOut.DisposeEmail()
        return
    }


    mailman.DisposeMailMan()
    emailOut.DisposeEmail()