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

Transition from MailMan.FetchEmail to MailMan.FetchByUidl

Provides instructions for replacing deprecated FetchEmail method calls with FetchByUidl.

Chilkat Go Downloads

Go
    success := false

    mailman := chilkat.NewMailMan()

    //  ...
    //  ...

    uidl := "123"

    //  ------------------------------------------------------------------------
    //  The FetchEmail method is deprecated:

    emailObj := mailman.FetchEmail(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 := false
    //  Irrelevant because we are not downloading headers-only.
    numBodyLines := 0

    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()