(VB.NET) Transition from Imap.FetchSingleHeader to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingleHeader method calls with FetchEmail. Note: This example requires Chilkat v11.0.0 or greater.
Dim imap As New Chilkat.Imap
' ...
' ...
' ------------------------------------------------------------------------
' The FetchSingleHeader method is deprecated:
Dim emailObj As Chilkat.Email = imap.FetchSingleHeader(1,False)
If (imap.LastMethodSuccess = False) Then
Debug.WriteLine(imap.LastErrorText)
Exit Sub
End If
' ...
' ...
' ------------------------------------------------------------------------
' Do the equivalent using FetchEmail.
' Your application creates a new, empty Email object which is passed
' in the last argument and filled upon success.
Dim headerOnly As Boolean = True
Dim emailOut As New Chilkat.Email
Dim success As Boolean = imap.FetchEmail(headerOnly,1,False,emailOut)
If (success = False) Then
Debug.WriteLine(imap.LastErrorText)
Exit Sub
End If
|