Sample code for 30+ languages & platforms
Go

Transition from MailMan.LoadXmlFile to EmailBundle.LoadXml

Provides instructions for replacing deprecated LoadXmlFile method calls with EmailBundle.LoadXml.

Chilkat Go Downloads

Go
    success := false

    mailman := chilkat.NewMailMan()

    // ...
    // ...

    filePath := "c:/example/emailBundle.xml"

    // ------------------------------------------------------------------------
    // The LoadXmlFile method is deprecated:

    bundleObj := mailman.LoadXmlFile(filePath)
    if mailman.LastMethodSuccess() == false {
        fmt.Println(mailman.LastErrorText())
        mailman.DisposeMailMan()
        return
    }

    // ...
    // ...

    bundleObj.DisposeEmailBundle()

    // ------------------------------------------------------------------------
    // Do the equivalent using EmailBundle.LoadXml.

    bundle := chilkat.NewEmailBundle()
    success = bundle.LoadXml(filePath)
    if success == false {
        fmt.Println(bundle.LastErrorText())
        mailman.DisposeMailMan()
        bundle.DisposeEmailBundle()
        return
    }


    mailman.DisposeMailMan()
    bundle.DisposeEmailBundle()