Go
Go
Transition from MailMan.CopyMail to MailMan.FetchAll
Provides instructions for replacing deprecated CopyMail method calls with FetchAll.Chilkat Go Downloads
success := false
mailman := chilkat.NewMailMan()
// ...
// ...
// ------------------------------------------------------------------------
// The CopyMail method is deprecated:
bundleObj := mailman.CopyMail()
if mailman.LastMethodSuccess() == false {
fmt.Println(mailman.LastErrorText())
mailman.DisposeMailMan()
return
}
// ...
// ...
bundleObj.DisposeEmailBundle()
// ------------------------------------------------------------------------
// Do the equivalent using FetchAll.
// Your application creates a new, empty EmailBundle object which is passed
// in the last argument and filled upon success.
keepOnServer := true
headersOnly := false
// Irrelevent because we are not downloading headers-only.
numBodyLines := 0
bundleOut := chilkat.NewEmailBundle()
success = mailman.FetchAll(keepOnServer,headersOnly,numBodyLines,bundleOut)
if success == false {
fmt.Println(mailman.LastErrorText())
mailman.DisposeMailMan()
bundleOut.DisposeEmailBundle()
return
}
mailman.DisposeMailMan()
bundleOut.DisposeEmailBundle()