LoadHeader Method

Load headers from email file to current POPMSG object for previewing.

[Syntax]
C++: HRESULT LoadHeader( BSTR FileName, long* pVal )
Visual Basic: LoadHeader( FileName As String ) As long
C#: long LoadHeader( string FileName )

Parameters

FileName

Name of the file to be loaded.

Return Value

If this method succeeds, the return value is zero. If it fails, the return value is non-zero.

Remarks

This method collects  subject, recipient and other header information of specified email without importing the whole email file.

Usage Example

[JScript]
var oMsg = new ActiveXObject("ANPOP.POPMSG");
if( oMsg.LoadHeader( "c:\\test.eml" ) == 0 )
  WScript.Echo( oMsg.GetSubject());//preview subject
  //Parse other header information, such as recipients, sender.
else
  WScript.Echo( "error with LoadHeader" );
[Visual Basic]
Dim oMsg As new ANPOPLib.POPMAIN

If( oMsg.LoadHeader( "c:\test.eml" ) = 0 Then
  MsgBox oMsg.GetSubject() 'preview subject
  'Parse other header information, such as recipients, sender.
Else
  MsgBox "error with LoadHeader"
End If
[C#]
POPMSGClass oMsg = new POPMSGClass();
if( oMsg.LoadHeader( "c:\\test.eml" ) == 0 )
  Console.WriteLine( oMsg.GetSubject());//preview subject
  //Parse other header information, such as recipients, sender.
else
  Console.WriteLine( "error with LoadHeader" );

See Also

ExportFile Method
RawContent Property


2001-2007 © Copyright AdminSystem Software Limited. All rights reserved.