Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PStringArray PPOP3Client::GetMessageHeaders (  ) 

Get an array of a strings representing the standard internet message headers of each of the messages in the mail box.

Note that the remote server may not support this function, in which case an empty array will be returned.

Returns:
Array of strings continaing message headers.

Definition at line 1078 of file inetmail.cxx.

References PInternetProtocol::ExecuteCommand(), GetMessageCount(), and PInternetProtocol::ReadLine().

{
  PStringArray headers;

  int count = GetMessageCount();
  for (int msgNum = 1; msgNum <= count; msgNum++) {
    if (ExecuteCommand(TOP, PString(PString::Unsigned,msgNum) + " 0") > 0) {
      PString headerLine;
      while (ReadLine(headerLine, TRUE))
        headers[msgNum-1] += headerLine;
    }
  }
  return headers;
}


Generated by  Doxygen 1.6.0   Back to index