(Go) Transition from Imap.FetchSingle to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail. Note: This example requires Chilkat v11.0.0 or greater.
imap := Imap_Ref.html">chilkat.NewImap()
// ...
// ...
// ------------------------------------------------------------------------
// The FetchSingle method is deprecated:
emailObj := imap.FetchSingle(1,false)
if imap.LastMethodSuccess() == false {
fmt.Println(imap.LastErrorText())
imap.DisposeImap()
return
}
// ...
// ...
emailObj.DisposeEmail()
// ------------------------------------------------------------------------
// Do the equivalent using FetchEmail.
// Your application creates a new, empty Email_Ref.html">Email object which is passed
// in the last argument and filled upon success.
headerOnly := false
email := Email_Ref.html">chilkat.NewEmail()
success := imap.FetchEmail(headerOnly,1,false,email)
if success == false {
fmt.Println(imap.LastErrorText())
imap.DisposeImap()
email.DisposeEmail()
return
}
imap.DisposeImap()
email.DisposeEmail()
|