Indy 9
TIdNNTP
Hierarchy, Properties, Methods, Events, See Also, Unit: IdNNTP
Implements an NNTP client.
TIdNNTP = class(TIdMessageClient)
Unit
IdNNTP
Description
TIdNNTP implements a client or newsreader based on the Network News Transfer Protocol (NNTP) as described in the Internet Standards documents:

  • RFC 977 - Network News Transfer Protocol (http://www.rfc-editor.org/rfc/rfc977.txt) .

  • RFC 2980 - Common NNTP Extensions (http://www.rfc-editor.org/rfc/rfc2980.txt) .

NNTP is used for distributing messages publicly to central locations on a network.


TIdNNTP.Mode
TIdNNTP, See Also
Indicates the NNTP command mode for the client connection.
property Mode: TModeType;
Description
Mode is a TModeType property that indicates the desired NNTP command mode for the client connection. Mode is used in the Connect method to set desired command mode, and results in an update to ModeResult indicated the server rsponse to the request.

When Mode contains the the value mtReader, the client connection is an NNTP newsreader that will used the conversational nature of the NNTP protocol during protocol exchanges.

When Mode contains the the value mtStream, the client connection wishes to suspend the conversational nature of NNTP, and send a stream of NNTP commands. mtStream is used with TakeThis, where articles are sent to an NNTP server in streaming mode.

mtReader is the default value for Mode, as assigned in the Create constructor.


TIdNNTP.ModeResult
TIdNNTP, See Also
Result from the NNTP MODE command.
property ModeResult: TModeSetResult;
Description
ModeResult is a TModeSetResult property that that respresents the result of an NNTP MODE command. ModeResult is updated in the Connect method to show if the requested Mode was successful or permitted on the NNTP server.

When Mode contains the value mtStream, ModeResult will contain one the values:

  • mrNoStream - Streaming not allowed or implemented.

  • mrCanStream - Streaming permitted.

When Mode contains the value mtReader, ModeResult will contain one the values:

  • mrNoPost - Posting not allowed.

  • mrCanPost - Posting permitted.

TIdNNTP.MsgCount
TIdNNTP, See Also
Estimated number of articles in the newsgroup.
property MsgCount: Integer;
Description
MsgCount is a read-only Integer property that represents the estimated number of articles in a newsgroup. MsgCount is updated when a newsgroup is activated using SelectGroup.

Use MsgHigh and MsgLow to access the message number ranges for the currently selected newsgroup.


TIdNNTP.MsgHigh
TIdNNTP, See Also
Indicates the highest available article in a newsgroup.
property MsgHigh: Integer;
Description
MsgHigh is a read-only Integer property that represents the highest available article index in a newsgroup. MsgHigh is updated when a newsgroup is activated using SelectGroup.

Use MsgLow to access the lower message number range for the currently selected newsgroup. Use MsgCount to get total number of messages in the currently selected newsgroup.


TIdNNTP.MsgLow
TIdNNTP, See Also
Indicates the lowest available article number in a newsgroup.
property MsgLow: Integer;
Description
MsgLow is a read-only Integer property that represents the lowest available article index in a newsgroup. MsgLow is updated when a newsgroup is activated using SelectGroup.

Use MsgHigh and MsgLow to access the message number ranges for the currently selected newsgroup.


TIdNNTP.NewsAgent
TIdNNTP, See Also
Identifies the newsreader that posts an article.
property NewsAgent: string;
Description
NewsAgent is a String property that specifies the name of the program, or newsreader, creating the news article. NewsAgent is written to the "X-Newsreader" headers found in TIdMessage.ExtraHeaders when Post is used to transmit the news article.

TIdNNTP.OnNewGroupsList
TIdNNTP, See Also
Event handler signalled on receipt of values in the new newsgroup list.
property OnNewGroupsList: TEventNewsGroupList;
Parameters
ACanContinue
True to continue newsgroup list retrieval. False to stop retrieval.
AHigh
Highest index number for an available article.
ALow
Lowest index number for an available article.
ANewsgroup
Name of the newsgroup.
AType
Posting status of the newsgroup.
Description
OnNewGroupsList is a TEventNewsGroupList property that represents the event handler triggered when new newsgroup are retrieved using the GetNewGroupsList method. OnNewGroupsList is used when GetNewGroupsList is called without a TStrings destination for the new newsgroup listing. OnNewGroupsList will be triggered once for each NNTP server response line retrieved and processed in GetNewGroupsList.

Applications must assigned a procedure to the event handler when TStrings is not used to store the newsgroup listing. If the event handler is unassigned, a EIdNNTPNoOnNewGroupsList exception will be raised. The event handler can be used to update the stored newsgroup list on the NNTP client using values in the event handler arguments. Setting ACanContinue to False stops the newsgroup retrieval.


TIdNNTP.Password
TIdNNTP, See Also
Represents the user authorization for connecting to the NNTP server.
property Password;
Description
Password is a String property that represents the user authorization for connecting to the NNTP server. Set Username to establish the identity used when autheticating the NNTP client connection.

Username and Password are used when SendCmd encounters NNTP response codes 450 and 480 when executing NNTP protocol commands. Values in Username and Password are send to the server using the NNTP service extension AUTHINFO.


TIdNNTP.Permission
TIdNNTP, See Also
Represents posting permissions granted to the NNTP client.
property Permission: TIdNNTPPermission;
Description
Permission is a TIdNNTPPermission property that represents the posting permission granted to the NNTP client. Permission can contain one of the following values representing an associated NNTP server responses:

  • crCanPost - 200 server ready (posting allowed)

  • crNoPost - 201 server ready (no posting allowed)

  • crAuthRequired - Not used at this time.

  • crTempUnavailable - 400 service discontinued

Permission is updated when Connect is used to open a connection to NNTP server and read the herald message.


TIdNNTP.Port
TIdNNTP, See Also
Port number for a connection to an NNTP server.
property Port: integer;
Description
Port is an Integer property that identifies the port number used in the connection to an NNTP server. Port is redefined in TIdNNTP to specify the default value for the property as required by the NNTP protocol (IdPORT_NNTP), as assigned in the Create method.

TIdNNTP.Username
TIdNNTP, See Also
Represents the user identity for connecting to the NNTP server.
property Username;
Description
Username is a String property that represents the user identity for connecting to the NNTP server. Set Password to establish the authorization used for the NNTP client connection.

Username and Password are used when SendCmd encounters NNTP response codes 450 and 480 when executing NNTP protocol commands. Values in Username and Password are send to the server using the NNTP service extension AUTHINFO.


TIdNNTP.Check
TIdNNTP, See Also
Determines if messages can be accepted by the NNTP server.
procedure Check(AMsgIDs: TStringList; var AResponses: TStringList);
Parameters
AMsgIDs: TStringList
List of message IDs to verify.
var AResponses: TStringList
List of responses from the server.
Description
Check is procedure that determines if an NNTP server can or will accept the list of message identifiers in AMsgIDs. Check is used to determine if a specific message identifier can be subsequently used with the TakeThis method by examining the server responses in AResponses.

AMsgIDs should contain one message identifier per line for each message to be checked. Check calls SendCmd using the NNTP CHECK command for each value in AMsgIDs. Check does not wait for a server response after each CHECK command, but reads the expected number of responses prior to exiting from the method.

AResponses will contain the responses received for the message identifiers in AMsgIDs. Use AResponses to determine which messages should be sent to the server. Server responses can include the following values and associated meanings:

  • 238 no such article found, please send it to me

  • 400 not accepting articles

  • 431 try sending it again later

  • 438 already have it, please don't send it to me

  • 480 Transfer permission denied

  • 500 Command not understood

Responses in the form X3X will include the message identifier in the text of the response.

Check will raise an EIdNNTPStringListNotInitialized exception if AResponses is not a valid TStrings instance.

For some NNTP server implementations, use of Check is optional prior to message transmission when Mode contains the value mtStream. The NNTP client can send all message identifiers using the TakeThis method.


TIdNNTP.Connect
TIdNNTP, See Also
Opens a connection to the NNTP server.
procedure Connect(const ATimeout: Integer = IdTimeoutDefault); override;
Parameters
const ATimeout: Integer = IdTimeoutDefault
Milliseconds to wait for a connection to the server. The default value is IdTimeoutDefault.
Description
Connect is an overridden procedure in TIdNNTP used to open a connection to the NNTP server using values in the Host and Port properties. Connect calls the inherited Connect method using the value in ATimeout to establish the connection, and calls GetResponse to determine the NNTP protocol response included as part of the server greeting. Connect sets the value in Permission based on the numeric response code in LastCmdResult using the following: values and associated Permissions:

  • 200 - crCanPost (Posting allowed)

  • 201 - crNoPost (Posting not allowed)

  • 400 - crTempUnavailable (Temporarily unavailable)

  • 502 - none (Connection refused)

Connect will raise an EIdNNTPConnectionRefused exception when the numeric response code in LastCmdResult is 502, indicating that the connection request was explicitly refused by the NNTP server. Note: If an Exception is encountered, Connect will call the Disconnect method and re-raise the exception.

Connect will also attempt to set the mode for the NNTP client connection using the NNTP MODE command and the TModeType value in the Mode property. Connect stores the result of the Mode request in the ModeResult property.

When Mode contains mtStream, ModeResult receives the value mrCanStream if the LastCmdResult contains the numeric value 203. Any other numeric response code causes ModeResult to contain mrNoStream.

When Mode contains mtReader, ModeResult receives the value mrCanPost if the LastCmdResult contains the numeric value 200. Any other numeric response code causes ModeResult to contain mrNoPost.


TIdNNTP.Create
TIdNNTP, See Also
Constructor for the class instance.
constructor Create(AOwner: TComponent); override;
Parameters
AOwner: TComponent
Owner of this object instance.
Description
Create is the constructor for the object instance. Create calls the inhertied Create method using AOwner as the owner of the object instance. Create sets the default value for the Mode property to mtReader, and sets Port to the default port number used for the NNTP protocol (IdPORT_NNTP).

TIdNNTP.Disconnect
TIdNNTP, See Also
Informs a server that the client wishes to close the connection.
procedure Disconnect; override;
Description
Disconnect is a procedure used to inform a NNTP server that the client will be closing the NNTP connection. When the NNTP client is Connected, Disconnect transmits the NNTP QUIT command and calls the inherited Disconnect method.

TIdNNTP.GetArticle
TIdNNTP, See Also
Retrieves a complete NNTP article.
function GetArticle(AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetArticle(AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetArticle(AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Description
GetArticle is an overloaded Boolean function in TIdNNTP used to retrieve a complete NNTP article including the headers and body. GetArticle calls SendCmd to issue the NNTP ARTICLE command used to perform article retrieval using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetArticle functions also provide for storing the contents of the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetArticle with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetArticle with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetArticle calls ReceiveHeader and ReceiveBody using AMsg as an argument. When TStrings or TStream are used as the destination, GetArticle calls Capture using AMsg as an argument.

The return value for GetArticle is True when the numeric response from SendCmd is 220. GetArticle will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetArticle. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetBody to retrieve the body text for a specific NNTP article.


TIdNNTP.GetArticle
TIdNNTP, See Also
Retrieves a complete NNTP article.
function GetArticle(AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetArticle(AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetArticle(AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Description
GetArticle is an overloaded Boolean function in TIdNNTP used to retrieve a complete NNTP article including the headers and body. GetArticle calls SendCmd to issue the NNTP ARTICLE command used to perform article retrieval using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetArticle functions also provide for storing the contents of the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetArticle with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetArticle with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetArticle calls ReceiveHeader and ReceiveBody using AMsg as an argument. When TStrings or TStream are used as the destination, GetArticle calls Capture using AMsg as an argument.

The return value for GetArticle is True when the numeric response from SendCmd is 220. GetArticle will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetArticle. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetBody to retrieve the body text for a specific NNTP article.


TIdNNTP.GetArticle
TIdNNTP, See Also
Retrieves a complete NNTP article.
function GetArticle(AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetArticle(AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetArticle(AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Description
GetArticle is an overloaded Boolean function in TIdNNTP used to retrieve a complete NNTP article including the headers and body. GetArticle calls SendCmd to issue the NNTP ARTICLE command used to perform article retrieval using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetArticle functions also provide for storing the contents of the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetArticle with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetArticle with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetArticle calls ReceiveHeader and ReceiveBody using AMsg as an argument. When TStrings or TStream are used as the destination, GetArticle calls Capture using AMsg as an argument.

The return value for GetArticle is True when the numeric response from SendCmd is 220. GetArticle will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetArticle. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetBody to retrieve the body text for a specific NNTP article.


TIdNNTP.GetArticle
TIdNNTP, See Also
Retrieves a complete NNTP article.
function GetArticle(AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetArticle(AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetArticle(AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Description
GetArticle is an overloaded Boolean function in TIdNNTP used to retrieve a complete NNTP article including the headers and body. GetArticle calls SendCmd to issue the NNTP ARTICLE command used to perform article retrieval using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetArticle functions also provide for storing the contents of the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetArticle with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetArticle with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetArticle calls ReceiveHeader and ReceiveBody using AMsg as an argument. When TStrings or TStream are used as the destination, GetArticle calls Capture using AMsg as an argument.

The return value for GetArticle is True when the numeric response from SendCmd is 220. GetArticle will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetArticle. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetBody to retrieve the body text for a specific NNTP article.


TIdNNTP.GetArticle
TIdNNTP, See Also
Retrieves a complete NNTP article.
function GetArticle(AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetArticle(AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetArticle(AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Description
GetArticle is an overloaded Boolean function in TIdNNTP used to retrieve a complete NNTP article including the headers and body. GetArticle calls SendCmd to issue the NNTP ARTICLE command used to perform article retrieval using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetArticle functions also provide for storing the contents of the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetArticle with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetArticle with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetArticle calls ReceiveHeader and ReceiveBody using AMsg as an argument. When TStrings or TStream are used as the destination, GetArticle calls Capture using AMsg as an argument.

The return value for GetArticle is True when the numeric response from SendCmd is 220. GetArticle will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetArticle. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetBody to retrieve the body text for a specific NNTP article.


TIdNNTP.GetArticle
TIdNNTP, See Also
Retrieves a complete NNTP article.
function GetArticle(AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetArticle(AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetArticle(AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Description
GetArticle is an overloaded Boolean function in TIdNNTP used to retrieve a complete NNTP article including the headers and body. GetArticle calls SendCmd to issue the NNTP ARTICLE command used to perform article retrieval using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetArticle functions also provide for storing the contents of the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetArticle with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetArticle with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetArticle calls ReceiveHeader and ReceiveBody using AMsg as an argument. When TStrings or TStream are used as the destination, GetArticle calls Capture using AMsg as an argument.

The return value for GetArticle is True when the numeric response from SendCmd is 220. GetArticle will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetArticle. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetBody to retrieve the body text for a specific NNTP article.


TIdNNTP.GetArticle
TIdNNTP, See Also
Retrieves a complete NNTP article.
function GetArticle(AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetArticle(AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetArticle(AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Description
GetArticle is an overloaded Boolean function in TIdNNTP used to retrieve a complete NNTP article including the headers and body. GetArticle calls SendCmd to issue the NNTP ARTICLE command used to perform article retrieval using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetArticle functions also provide for storing the contents of the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetArticle with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetArticle with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetArticle calls ReceiveHeader and ReceiveBody using AMsg as an argument. When TStrings or TStream are used as the destination, GetArticle calls Capture using AMsg as an argument.

The return value for GetArticle is True when the numeric response from SendCmd is 220. GetArticle will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetArticle. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetBody to retrieve the body text for a specific NNTP article.


TIdNNTP.GetArticle
TIdNNTP, See Also
Retrieves a complete NNTP article.
function GetArticle(AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetArticle(AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetArticle(AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Description
GetArticle is an overloaded Boolean function in TIdNNTP used to retrieve a complete NNTP article including the headers and body. GetArticle calls SendCmd to issue the NNTP ARTICLE command used to perform article retrieval using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetArticle functions also provide for storing the contents of the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetArticle with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetArticle with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetArticle calls ReceiveHeader and ReceiveBody using AMsg as an argument. When TStrings or TStream are used as the destination, GetArticle calls Capture using AMsg as an argument.

The return value for GetArticle is True when the numeric response from SendCmd is 220. GetArticle will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetArticle. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetBody to retrieve the body text for a specific NNTP article.


TIdNNTP.GetArticle
TIdNNTP, See Also
Retrieves a complete NNTP article.
function GetArticle(AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetArticle(AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetArticle(AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetArticle(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Description
GetArticle is an overloaded Boolean function in TIdNNTP used to retrieve a complete NNTP article including the headers and body. GetArticle calls SendCmd to issue the NNTP ARTICLE command used to perform article retrieval using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetArticle functions also provide for storing the contents of the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetArticle with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetArticle with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetArticle calls ReceiveHeader and ReceiveBody using AMsg as an argument. When TStrings or TStream are used as the destination, GetArticle calls Capture using AMsg as an argument.

The return value for GetArticle is True when the numeric response from SendCmd is 220. GetArticle will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetArticle. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetBody to retrieve the body text for a specific NNTP article.


TIdNNTP.GetBody
TIdNNTP, See Also
Retrieves the body for an NNTP article.
function GetBody(AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetBody(AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetBody(AMsg: TStream): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetBody is an overloaded Boolean function in TIdNNTP used to retrieve the message body for a NNTP article. GetBody calls SendCmd using the NNTP BODY command to retrieve body lines. The overloaded functions provide for retrieving the body for the article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetBody functions also provide for storing the body lines for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetBody with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetBody with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetBody clears the contents of the message using TIdMessage.Clear and calls ReceiveBody using AMsg as an argument. When TStrings is used as the destination, GetBody clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetBody calls Capture using AMsg as an argument.

The return value for GetBody is True when the numeric response from SendCmd is 222. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetBody. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.


TIdNNTP.GetBody
TIdNNTP, See Also
Retrieves the body for an NNTP article.
function GetBody(AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetBody(AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetBody(AMsg: TStream): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetBody is an overloaded Boolean function in TIdNNTP used to retrieve the message body for a NNTP article. GetBody calls SendCmd using the NNTP BODY command to retrieve body lines. The overloaded functions provide for retrieving the body for the article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetBody functions also provide for storing the body lines for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetBody with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetBody with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetBody clears the contents of the message using TIdMessage.Clear and calls ReceiveBody using AMsg as an argument. When TStrings is used as the destination, GetBody clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetBody calls Capture using AMsg as an argument.

The return value for GetBody is True when the numeric response from SendCmd is 222. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetBody. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.


TIdNNTP.GetBody
TIdNNTP, See Also
Retrieves the body for an NNTP article.
function GetBody(AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetBody(AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetBody(AMsg: TStream): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetBody is an overloaded Boolean function in TIdNNTP used to retrieve the message body for a NNTP article. GetBody calls SendCmd using the NNTP BODY command to retrieve body lines. The overloaded functions provide for retrieving the body for the article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetBody functions also provide for storing the body lines for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetBody with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetBody with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetBody clears the contents of the message using TIdMessage.Clear and calls ReceiveBody using AMsg as an argument. When TStrings is used as the destination, GetBody clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetBody calls Capture using AMsg as an argument.

The return value for GetBody is True when the numeric response from SendCmd is 222. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetBody. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.


TIdNNTP.GetBody
TIdNNTP, See Also
Retrieves the body for an NNTP article.
function GetBody(AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetBody(AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetBody(AMsg: TStream): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetBody is an overloaded Boolean function in TIdNNTP used to retrieve the message body for a NNTP article. GetBody calls SendCmd using the NNTP BODY command to retrieve body lines. The overloaded functions provide for retrieving the body for the article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetBody functions also provide for storing the body lines for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetBody with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetBody with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetBody clears the contents of the message using TIdMessage.Clear and calls ReceiveBody using AMsg as an argument. When TStrings is used as the destination, GetBody clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetBody calls Capture using AMsg as an argument.

The return value for GetBody is True when the numeric response from SendCmd is 222. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetBody. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.


TIdNNTP.GetBody
TIdNNTP, See Also
Retrieves the body for an NNTP article.
function GetBody(AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetBody(AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetBody(AMsg: TStream): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetBody is an overloaded Boolean function in TIdNNTP used to retrieve the message body for a NNTP article. GetBody calls SendCmd using the NNTP BODY command to retrieve body lines. The overloaded functions provide for retrieving the body for the article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetBody functions also provide for storing the body lines for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetBody with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetBody with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetBody clears the contents of the message using TIdMessage.Clear and calls ReceiveBody using AMsg as an argument. When TStrings is used as the destination, GetBody clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetBody calls Capture using AMsg as an argument.

The return value for GetBody is True when the numeric response from SendCmd is 222. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetBody. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.


TIdNNTP.GetBody
TIdNNTP, See Also
Retrieves the body for an NNTP article.
function GetBody(AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetBody(AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetBody(AMsg: TStream): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetBody is an overloaded Boolean function in TIdNNTP used to retrieve the message body for a NNTP article. GetBody calls SendCmd using the NNTP BODY command to retrieve body lines. The overloaded functions provide for retrieving the body for the article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetBody functions also provide for storing the body lines for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetBody with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetBody with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetBody clears the contents of the message using TIdMessage.Clear and calls ReceiveBody using AMsg as an argument. When TStrings is used as the destination, GetBody clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetBody calls Capture using AMsg as an argument.

The return value for GetBody is True when the numeric response from SendCmd is 222. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetBody. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.


TIdNNTP.GetBody
TIdNNTP, See Also
Retrieves the body for an NNTP article.
function GetBody(AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetBody(AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetBody(AMsg: TStream): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetBody is an overloaded Boolean function in TIdNNTP used to retrieve the message body for a NNTP article. GetBody calls SendCmd using the NNTP BODY command to retrieve body lines. The overloaded functions provide for retrieving the body for the article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetBody functions also provide for storing the body lines for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetBody with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetBody with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetBody clears the contents of the message using TIdMessage.Clear and calls ReceiveBody using AMsg as an argument. When TStrings is used as the destination, GetBody clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetBody calls Capture using AMsg as an argument.

The return value for GetBody is True when the numeric response from SendCmd is 222. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetBody. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.


TIdNNTP.GetBody
TIdNNTP, See Also
Retrieves the body for an NNTP article.
function GetBody(AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetBody(AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetBody(AMsg: TStream): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetBody is an overloaded Boolean function in TIdNNTP used to retrieve the message body for a NNTP article. GetBody calls SendCmd using the NNTP BODY command to retrieve body lines. The overloaded functions provide for retrieving the body for the article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetBody functions also provide for storing the body lines for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetBody with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetBody with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetBody clears the contents of the message using TIdMessage.Clear and calls ReceiveBody using AMsg as an argument. When TStrings is used as the destination, GetBody clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetBody calls Capture using AMsg as an argument.

The return value for GetBody is True when the numeric response from SendCmd is 222. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetBody. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.


TIdNNTP.GetBody
TIdNNTP, See Also
Retrieves the body for an NNTP article.
function GetBody(AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetBody(AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetBody(AMsg: TStream): Boolean; overload;
function GetBody(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetBody(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetBody is an overloaded Boolean function in TIdNNTP used to retrieve the message body for a NNTP article. GetBody calls SendCmd using the NNTP BODY command to retrieve body lines. The overloaded functions provide for retrieving the body for the article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetBody functions also provide for storing the body lines for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetBody with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetBody with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetBody clears the contents of the message using TIdMessage.Clear and calls ReceiveBody using AMsg as an argument. When TStrings is used as the destination, GetBody clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetBody calls Capture using AMsg as an argument.

The return value for GetBody is True when the numeric response from SendCmd is 222. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetBody. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.


TIdNNTP.GetHeader
TIdNNTP, See Also
Retrieves the headers for an NNTP article.
function GetHeader(AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetHeader(AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetHeader(AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetHeader is an overloaded Boolean function in TIdNNTP used to retrieve message headers for an NNTP article. GetHeader calls SendCmd using the NNTP HEAD command to retrieve message headers. The overloaded functions provide for retrieving the headers for an article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetHeader functions also provide for storing the message headers for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetHeader with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetHeader with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetHeader clears the contents of the message using TIdMessage.Clear and calls ReceiveHeader using AMsg as an argument. When TStrings is used as the destination, GetHeader clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetHeader calls Capture using AMsg as an argument.

The return value for GetHeader is True when the numeric response from SendCmd is 221. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetHeader. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetBody to retrieve the body lines for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.

Use XOVER to get information from the overview database for one or more NNTP articles.


TIdNNTP.GetHeader
TIdNNTP, See Also
Retrieves the headers for an NNTP article.
function GetHeader(AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetHeader(AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetHeader(AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetHeader is an overloaded Boolean function in TIdNNTP used to retrieve message headers for an NNTP article. GetHeader calls SendCmd using the NNTP HEAD command to retrieve message headers. The overloaded functions provide for retrieving the headers for an article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetHeader functions also provide for storing the message headers for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetHeader with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetHeader with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetHeader clears the contents of the message using TIdMessage.Clear and calls ReceiveHeader using AMsg as an argument. When TStrings is used as the destination, GetHeader clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetHeader calls Capture using AMsg as an argument.

The return value for GetHeader is True when the numeric response from SendCmd is 221. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetHeader. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetBody to retrieve the body lines for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.

Use XOVER to get information from the overview database for one or more NNTP articles.


TIdNNTP.GetHeader
TIdNNTP, See Also
Retrieves the headers for an NNTP article.
function GetHeader(AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetHeader(AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetHeader(AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetHeader is an overloaded Boolean function in TIdNNTP used to retrieve message headers for an NNTP article. GetHeader calls SendCmd using the NNTP HEAD command to retrieve message headers. The overloaded functions provide for retrieving the headers for an article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetHeader functions also provide for storing the message headers for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetHeader with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetHeader with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetHeader clears the contents of the message using TIdMessage.Clear and calls ReceiveHeader using AMsg as an argument. When TStrings is used as the destination, GetHeader clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetHeader calls Capture using AMsg as an argument.

The return value for GetHeader is True when the numeric response from SendCmd is 221. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetHeader. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetBody to retrieve the body lines for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.

Use XOVER to get information from the overview database for one or more NNTP articles.


TIdNNTP.GetHeader
TIdNNTP, See Also
Retrieves the headers for an NNTP article.
function GetHeader(AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetHeader(AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetHeader(AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetHeader is an overloaded Boolean function in TIdNNTP used to retrieve message headers for an NNTP article. GetHeader calls SendCmd using the NNTP HEAD command to retrieve message headers. The overloaded functions provide for retrieving the headers for an article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetHeader functions also provide for storing the message headers for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetHeader with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetHeader with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetHeader clears the contents of the message using TIdMessage.Clear and calls ReceiveHeader using AMsg as an argument. When TStrings is used as the destination, GetHeader clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetHeader calls Capture using AMsg as an argument.

The return value for GetHeader is True when the numeric response from SendCmd is 221. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetHeader. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetBody to retrieve the body lines for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.

Use XOVER to get information from the overview database for one or more NNTP articles.


TIdNNTP.GetHeader
TIdNNTP, See Also
Retrieves the headers for an NNTP article.
function GetHeader(AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetHeader(AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetHeader(AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetHeader is an overloaded Boolean function in TIdNNTP used to retrieve message headers for an NNTP article. GetHeader calls SendCmd using the NNTP HEAD command to retrieve message headers. The overloaded functions provide for retrieving the headers for an article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetHeader functions also provide for storing the message headers for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetHeader with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetHeader with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetHeader clears the contents of the message using TIdMessage.Clear and calls ReceiveHeader using AMsg as an argument. When TStrings is used as the destination, GetHeader clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetHeader calls Capture using AMsg as an argument.

The return value for GetHeader is True when the numeric response from SendCmd is 221. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetHeader. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetBody to retrieve the body lines for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.

Use XOVER to get information from the overview database for one or more NNTP articles.


TIdNNTP.GetHeader
TIdNNTP, See Also
Retrieves the headers for an NNTP article.
function GetHeader(AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetHeader(AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetHeader(AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetHeader is an overloaded Boolean function in TIdNNTP used to retrieve message headers for an NNTP article. GetHeader calls SendCmd using the NNTP HEAD command to retrieve message headers. The overloaded functions provide for retrieving the headers for an article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetHeader functions also provide for storing the message headers for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetHeader with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetHeader with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetHeader clears the contents of the message using TIdMessage.Clear and calls ReceiveHeader using AMsg as an argument. When TStrings is used as the destination, GetHeader clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetHeader calls Capture using AMsg as an argument.

The return value for GetHeader is True when the numeric response from SendCmd is 221. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetHeader. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetBody to retrieve the body lines for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.

Use XOVER to get information from the overview database for one or more NNTP articles.


TIdNNTP.GetHeader
TIdNNTP, See Also
Retrieves the headers for an NNTP article.
function GetHeader(AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetHeader(AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetHeader(AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetHeader is an overloaded Boolean function in TIdNNTP used to retrieve message headers for an NNTP article. GetHeader calls SendCmd using the NNTP HEAD command to retrieve message headers. The overloaded functions provide for retrieving the headers for an article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetHeader functions also provide for storing the message headers for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetHeader with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetHeader with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetHeader clears the contents of the message using TIdMessage.Clear and calls ReceiveHeader using AMsg as an argument. When TStrings is used as the destination, GetHeader clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetHeader calls Capture using AMsg as an argument.

The return value for GetHeader is True when the numeric response from SendCmd is 221. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetHeader. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetBody to retrieve the body lines for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.

Use XOVER to get information from the overview database for one or more NNTP articles.


TIdNNTP.GetHeader
TIdNNTP, See Also
Retrieves the headers for an NNTP article.
function GetHeader(AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetHeader(AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetHeader(AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetHeader is an overloaded Boolean function in TIdNNTP used to retrieve message headers for an NNTP article. GetHeader calls SendCmd using the NNTP HEAD command to retrieve message headers. The overloaded functions provide for retrieving the headers for an article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetHeader functions also provide for storing the message headers for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetHeader with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetHeader with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetHeader clears the contents of the message using TIdMessage.Clear and calls ReceiveHeader using AMsg as an argument. When TStrings is used as the destination, GetHeader clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetHeader calls Capture using AMsg as an argument.

The return value for GetHeader is True when the numeric response from SendCmd is 221. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetHeader. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetBody to retrieve the body lines for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.

Use XOVER to get information from the overview database for one or more NNTP articles.


TIdNNTP.GetHeader
TIdNNTP, See Also
Retrieves the headers for an NNTP article.
function GetHeader(AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
function GetHeader(AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStrings): Boolean; overload;
function GetHeader(AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
function GetHeader(const AMsgID: string; AMsg: TStream): Boolean; overload;
Parameters
AMsg: TIdMessage
TIdMessage

where the complete article should be stored.

TStrings where the complete article should be stored.

Stream where the complete article should be stored.

const AMsgNo: Integer
Index number for the article.
const AMsgID: string
Message Identifier for the article.
Return Value
Boolean - True on success, False on protocol or server error.
Description
GetHeader is an overloaded Boolean function in TIdNNTP used to retrieve message headers for an NNTP article. GetHeader calls SendCmd using the NNTP HEAD command to retrieve message headers. The overloaded functions provide for retrieving the headers for an article using a numeric message number, a message identifier string, or the NNTP current article pointer.

The overloaded GetHeader functions also provide for storing the message headers for the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. When using GetHeader with a numeric article index, the NNTP current article pointer is set to the indicated article. When using GetHeader with a message identifier string, the NNTP current article pointer is NOT set to the indicated article.

When a TIdMessage instance is used as the destination, GetHeader clears the contents of the message using TIdMessage.Clear and calls ReceiveHeader using AMsg as an argument. When TStrings is used as the destination, GetHeader clears the contents of the message using TStrings.Clear and calls Capture using AMsg as an argument. When a TStream descendant is used as the destination, GetHeader calls Capture using AMsg as an argument.

The return value for GetHeader is True when the numeric response from SendCmd is 221. GetBody will return False if any of the following responses are received:

  • 412 no newsgroup has been selected

  • 420 no current article has been selected

  • 423 no such article number in this group

  • 430 no such article found

Use SelectGroup to select the active newsgroup before prior to calling GetHeader. Use SelectArticle to set the current article pointer for the active newsgroup. Use GetNewNewsList to get a list of articles added since a specified date and time.

Use GetBody to retrieve the body lines for a specific NNTP article. Use GetArticle to retrieve the entire contents of a specific NNTP article.

Use XOVER to get information from the overview database for one or more NNTP articles.


TIdNNTP.GetNewGroupsList
TIdNNTP, See Also
Retrieves a list of new newsgroups from an NNTP server.
procedure GetNewGroupsList(const ADate: TDateTime; const AGMT: boolean; const ADistributions: string); overload;
procedure GetNewGroupsList(const ADate: TDateTime; const AGMT: boolean; const ADistributions: string; AList: TStrings); overload;
Parameters
const ADate: TDateTime
Previous data and time the newsgroup list was retrieved.
const AGMT: boolean
Time is expressed in GMT.
const ADistributions: string
Optional list of distribution patterns.
AList: TStrings
Destination for the new newsgroups from the NNTP server.
Description
GetNewGroupsList is an overloaded procedure in TIdNNTP that requests a list of newsgroups from the NNTP server which were added after a specific date and time, and is normally used to update a stored list of newsgroups on an NNTP client.

ADate represents the date and time that the newsgroup list on the NNTP client was last updated, and is used to determine which groups in list have been added since that update.

When AGMT is True, the value in ADate is based on Greenwich Mean Time or Universal Time Coordinated (0 meridian). When AGMT is False, the value in ADate represents a value for the local time-zone.

ADistributions is an optional string containing a comma-delimited list of newsgroup prefixes to be used as a filter when retrieving the list of news newsgroups. For example, the following would limit newsgroup retrieval to the public Delphi andf C++ Builder hierarchy:

    'borland.public.delphi,borland.public.cppbuilder'

AList is an optional TStrings value to be used as the destination for new newsgroups retrieved from the NNTP server. When AList is assigned, GetNewGroupsList calls SendCmd using the NNTP NEWGROUPS command with the arguments specified. GetNewGroupsList calls Capture to store the server response lines in AList. Each line in AList is in the form:

      groupname last first p

Where the tokens in the response lines have the following meanings:

  • groupname - newsgroup name.

  • last - number of the last known article currently in that newsgroup.

  • first - number of the first article currently in the newsgroup.

  • p - posting status for the newsgroup. ('y'=allowed, 'n'=prohibited)

When AList is omitted, the OnNewGroupsList event handler is used to signal receipt and processing of individual lines from the new newsgroup list. Applications must assign a TEventNewsgroupList event handler to the property to allow responding to the notification. GetNewGroupsList will raise an EIdNNTPNoOnNewGroupsList exception if both AList and OnNewGroupsList are unassigned.


TIdNNTP.GetNewGroupsList
TIdNNTP, See Also
Retrieves a list of new newsgroups from an NNTP server.
procedure GetNewGroupsList(const ADate: TDateTime; const AGMT: boolean; const ADistributions: string); overload;
procedure GetNewGroupsList(const ADate: TDateTime; const AGMT: boolean; const ADistributions: string; AList: TStrings); overload;
Parameters
const ADate: TDateTime
Previous data and time the newsgroup list was retrieved.
const AGMT: boolean
Time is expressed in GMT.
const ADistributions: string
Optional list of distribution patterns.
AList: TStrings
Destination for the new newsgroups from the NNTP server.
Description
GetNewGroupsList is an overloaded procedure in TIdNNTP that requests a list of newsgroups from the NNTP server which were added after a specific date and time, and is normally used to update a stored list of newsgroups on an NNTP client.

ADate represents the date and time that the newsgroup list on the NNTP client was last updated, and is used to determine which groups in list have been added since that update.

When AGMT is True, the value in ADate is based on Greenwich Mean Time or Universal Time Coordinated (0 meridian). When AGMT is False, the value in ADate represents a value for the local time-zone.

ADistributions is an optional string containing a comma-delimited list of newsgroup prefixes to be used as a filter when retrieving the list of news newsgroups. For example, the following would limit newsgroup retrieval to the public Delphi andf C++ Builder hierarchy:

    'borland.public.delphi,borland.public.cppbuilder'

AList is an optional TStrings value to be used as the destination for new newsgroups retrieved from the NNTP server. When AList is assigned, GetNewGroupsList calls SendCmd using the NNTP NEWGROUPS command with the arguments specified. GetNewGroupsList calls Capture to store the server response lines in AList. Each line in AList is in the form:

      groupname last first p

Where the tokens in the response lines have the following meanings:

  • groupname - newsgroup name.

  • last - number of the last known article currently in that newsgroup.

  • first - number of the first article currently in the newsgroup.

  • p - posting status for the newsgroup. ('y'=allowed, 'n'=prohibited)

When AList is omitted, the OnNewGroupsList event handler is used to signal receipt and processing of individual lines from the new newsgroup list. Applications must assign a TEventNewsgroupList event handler to the property to allow responding to the notification. GetNewGroupsList will raise an EIdNNTPNoOnNewGroupsList exception if both AList and OnNewGroupsList are unassigned.


TIdNNTP.GetNewNewsList
TIdNNTP, See Also
Retrieves a list of message identifiers for new articles.
procedure GetNewNewsList(const ANewsgroups: string; const ADate: TDateTime; const AGMT: boolean; ADistributions: string); overload;
procedure GetNewNewsList(const ANewsgroups: string; const ADate: TDateTime; const AGMT: boolean; ADistributions: string; AList: TStrings); overload;
Parameters
const ANewsgroups: string
Name of the newsgroup to be examined.
const ADate: TDateTime
Previous data and time the newsgroup list was retrieved.
const AGMT: boolean
Time is expressed in GMT.
ADistributions: string
Optional list of distribution patterns.
AList: TStrings
Destination for the new newsgroups from the NNTP server.
Description
GetNewNewsList is an overloaded procedure in TIdNNTP used to retrieve a list of message identifiers posted or received in a specified newsgroup since a given date and time.

ANewsgroups can contain a value that identifies the name or search patterns used in locating newsgroups to be included in the list of new message identifiers. ANewsgroups can contain the '*' (asterisk) indicating that the search will match any newsgroup name matching fixed portions of the search value. Multiple newsgroup names or search patterns may be specified as a comma-delimited list. Note: Implementors are cautioned to remember the 512 character command length limit in NNTP commands.

For instance, 'net.micro*' will match 'net.micro.wombat', 'net.micro.apple', etc. In addition, 'net.*.unix' would match newsgroups with names like 'net.wombat.unix' and 'net.whocares.unix'.

If only an asterisk character is given in ANewsgroups , all newsgroups will be searched for new message identifiers. If no asterisk appears in a given newsgroup name, only the specified newsgroup will be searched for new articles.

ANewsgroups may also contain an exclamation point ('!') character used to negate a match, and omit newsgroups matching the specified names or search patterns. For example, a newsgroups specification of 'net.*,mod.*,!mod.map.*' would specify that all groups starting with 'net.' or 'mod.' except newsgroups starting with 'mod.map.' would be matched. If used, the exclamation point must appear as the first character of the given newsgroup name or pattern.

ADate represents the date and time to be used in determining which message identifiers are included in the list of new articles.

When AGMT is True, the value in ADate is based on Greenwich Mean Time or Universal Time Coordinated (0 meridian). When AGMT is False, the value in ADate represents a value for the local time-zone.

ADistributions is an optional string containing a comma-delimited list of newsgroups or prefixes to be used as a filter when retrieving the list new articles. Only those articles which have at least one newsgroup belonging to the list of distributions will be returned in the list of new articles.

AList is an optional TStrings value to be used as the destination for new message identifiers retrieved from the NNTP server. When AList is assigned, GetNewNewsList calls SendCmd using the NNTP NEWNEWS command with the arguments specified. GetNewNewsList calls Capture to store the server response lines in AList. Each line in AList will contain one message identifier.

When AList is omitted, the OnNewNewsList event handler is used to signal receipt and processing of individual message identifiers from the new articles list. Applications must assign a TEventNewNewsList event handler to the property to allow responding to the notification. GetNewNewsList will raise an EIdNNTPNoOnNewNewsList exception if both AList and OnNewNewsList are unassigned.


TIdNNTP.GetNewNewsList
TIdNNTP, See Also
Retrieves a list of message identifiers for new articles.
procedure GetNewNewsList(const ANewsgroups: string; const ADate: TDateTime; const AGMT: boolean; ADistributions: string); overload;
procedure GetNewNewsList(const ANewsgroups: string; const ADate: TDateTime; const AGMT: boolean; ADistributions: string; AList: TStrings); overload;
Parameters
const ANewsgroups: string
Name of the newsgroup to be examined.
const ADate: TDateTime
Previous data and time the newsgroup list was retrieved.
const AGMT: boolean
Time is expressed in GMT.
ADistributions: string
Optional list of distribution patterns.
AList: TStrings
Destination for the new newsgroups from the NNTP server.
Description
GetNewNewsList is an overloaded procedure in TIdNNTP used to retrieve a list of message identifiers posted or received in a specified newsgroup since a given date and time.

ANewsgroups can contain a value that identifies the name or search patterns used in locating newsgroups to be included in the list of new message identifiers. ANewsgroups can contain the '*' (asterisk) indicating that the search will match any newsgroup name matching fixed portions of the search value. Multiple newsgroup names or search patterns may be specified as a comma-delimited list. Note: Implementors are cautioned to remember the 512 character command length limit in NNTP commands.

For instance, 'net.micro*' will match 'net.micro.wombat', 'net.micro.apple', etc. In addition, 'net.*.unix' would match newsgroups with names like 'net.wombat.unix' and 'net.whocares.unix'.

If only an asterisk character is given in ANewsgroups , all newsgroups will be searched for new message identifiers. If no asterisk appears in a given newsgroup name, only the specified newsgroup will be searched for new articles.

ANewsgroups may also contain an exclamation point ('!') character used to negate a match, and omit newsgroups matching the specified names or search patterns. For example, a newsgroups specification of 'net.*,mod.*,!mod.map.*' would specify that all groups starting with 'net.' or 'mod.' except newsgroups starting with 'mod.map.' would be matched. If used, the exclamation point must appear as the first character of the given newsgroup name or pattern.

ADate represents the date and time to be used in determining which message identifiers are included in the list of new articles.

When AGMT is True, the value in ADate is based on Greenwich Mean Time or Universal Time Coordinated (0 meridian). When AGMT is False, the value in ADate represents a value for the local time-zone.

ADistributions is an optional string containing a comma-delimited list of newsgroups or prefixes to be used as a filter when retrieving the list new articles. Only those articles which have at least one newsgroup belonging to the list of distributions will be returned in the list of new articles.

AList is an optional TStrings value to be used as the destination for new message identifiers retrieved from the NNTP server. When AList is assigned, GetNewNewsList calls SendCmd using the NNTP NEWNEWS command with the arguments specified. GetNewNewsList calls Capture to store the server response lines in AList. Each line in AList will contain one message identifier.

When AList is omitted, the OnNewNewsList event handler is used to signal receipt and processing of individual message identifiers from the new articles list. Applications must assign a TEventNewNewsList event handler to the property to allow responding to the notification. GetNewNewsList will raise an EIdNNTPNoOnNewNewsList exception if both AList and OnNewNewsList are unassigned.


TIdNNTP.GetNewsgroupList
TIdNNTP, See Also
Requests a list of newsgroups on a server.
procedure GetNewsgroupList; overload;
Parameters
AList
Destination for the newsgroup list.
AStream
Destination for the newsgroup list.
Description
GetNewsgroupList is an overloaded procedure in TIdNNTP that retrieves the list of valid newsgroups on the NNTP server. GetNewsgroupList implements the NNTP LIST command to retrieve newsgroup information returned in the NNTP server response.

The overloaded GetNewsgroupList procedures provide for handling NNTP server response lines using the OnNewsgroupList event handler, or storing server responses in either the AList or the AStream arguments.

When GetNewsgroupList is called with no parameters, the OnNewsgroupList event handler is used to process receipt of individual response lines containing newsgroup information. Applications must assign a TEventNewsgroupList event handler to the OnNewsgroupList property to allow responding to the notification. An EIdNNTPNoOnNewsgroupList will be raised if the event handler is unassigned.

When GetNewsgroupList is called with a TStrings argument, newsgroup information is stored in AList using Capture. Use ParseNewsGroup to return component values from lines in AList.

When GetNewsgroupList is called with a TStream argument, newsgroup information is stored in AStream using Capture.

Newsgroup information returned in an NNTP server response consists of multiple lines of text in the form:

      groupname last first p

Where the tokens in the response lines have the following meanings:

  • groupname - newsgroup name.

  • last - number of the last known article currently in that newsgroup.

  • first - number of the first article currently in the newsgroup.

  • p - posting status for the newsgroup. ('y'=allowed, 'n'=prohibited)

TIdNNTP.GetNewsgroupList
TIdNNTP, See Also
Requests a list of newsgroups on a server.
procedure GetNewsgroupList(AList: TStrings); overload;
procedure GetNewsgroupList(AStream: TStream); overload;
Parameters
AList: TStrings
Destination for the newsgroup list.
AStream: TStream
Destination for the newsgroup list.
Description
GetNewsgroupList is an overloaded procedure in TIdNNTP that retrieves the list of valid newsgroups on the NNTP server. GetNewsgroupList implements the NNTP LIST command to retrieve newsgroup information returned in the NNTP server response.

The overloaded GetNewsgroupList procedures provide for handling NNTP server response lines using the OnNewsgroupList event handler, or storing server responses in either the AList or the AStream arguments.

When GetNewsgroupList is called with no parameters, the OnNewsgroupList event handler is used to process receipt of individual response lines containing newsgroup information. Applications must assign a TEventNewsgroupList event handler to the OnNewsgroupList property to allow responding to the notification. An EIdNNTPNoOnNewsgroupList will be raised if the event handler is unassigned.

When GetNewsgroupList is called with a TStrings argument, newsgroup information is stored in AList using Capture. Use ParseNewsGroup to return component values from lines in AList.

When GetNewsgroupList is called with a TStream argument, newsgroup information is stored in AStream using Capture.

Newsgroup information returned in an NNTP server response consists of multiple lines of text in the form:

      groupname last first p

Where the tokens in the response lines have the following meanings:

  • groupname - newsgroup name.

  • last - number of the last known article currently in that newsgroup.

  • first - number of the first article currently in the newsgroup.

  • p - posting status for the newsgroup. ('y'=allowed, 'n'=prohibited)

TIdNNTP.GetNewsgroupList
TIdNNTP, See Also
Requests a list of newsgroups on a server.
procedure GetNewsgroupList(AList: TStrings); overload;
procedure GetNewsgroupList(AStream: TStream); overload;
Parameters
AList: TStrings
Destination for the newsgroup list.
AStream: TStream
Destination for the newsgroup list.
Description
GetNewsgroupList is an overloaded procedure in TIdNNTP that retrieves the list of valid newsgroups on the NNTP server. GetNewsgroupList implements the NNTP LIST command to retrieve newsgroup information returned in the NNTP server response.

The overloaded GetNewsgroupList procedures provide for handling NNTP server response lines using the OnNewsgroupList event handler, or storing server responses in either the AList or the AStream arguments.

When GetNewsgroupList is called with no parameters, the OnNewsgroupList event handler is used to process receipt of individual response lines containing newsgroup information. Applications must assign a TEventNewsgroupList event handler to the OnNewsgroupList property to allow responding to the notification. An EIdNNTPNoOnNewsgroupList will be raised if the event handler is unassigned.

When GetNewsgroupList is called with a TStrings argument, newsgroup information is stored in AList using Capture. Use ParseNewsGroup to return component values from lines in AList.

When GetNewsgroupList is called with a TStream argument, newsgroup information is stored in AStream using Capture.

Newsgroup information returned in an NNTP server response consists of multiple lines of text in the form:

      groupname last first p

Where the tokens in the response lines have the following meanings:

  • groupname - newsgroup name.

  • last - number of the last known article currently in that newsgroup.

  • first - number of the first article currently in the newsgroup.

  • p - posting status for the newsgroup. ('y'=allowed, 'n'=prohibited)

TIdNNTP.GetOverviewFMT
TIdNNTP, See Also
Retrieves the overview format from the server.
procedure GetOverviewFMT(var AResponse: TStringList);
Parameters
var AResponse: TStringList
Overview database format.
Description
GetOverviewFMT is a procedure that retrieves information from an NNTP server that describes the headers used in the overview database for each newsgroup. GetOverviewFMT implements the NNTP service extension for the LIST OVERVIEW.FMT command.

The OVERVIEW.FMT file is maintained by some news transport systems to indicate the order in which header information is stored in the overview databases for each newsgroup.

GetOverviewFMT captures the news article header fields in the order specified in the overview database, and stores the server responses in AResponse. If the NNTP server does not implement the LIST OVERVIEW.FMT the server will return a numeric response code of 503 in the LastCmdResult property.


TIdNNTP.IHAVE
TIdNNTP, See Also
Notifies the NNTP server of messages available for upload from the client.
procedure IHAVE(AMsg: TStringList);
Parameters
AMsg: TStringList
Message to be sent to the NNTP server.
Description
IHAVE is a procedure used to inform an NNTP server that the client has an NNTP article available for upload. AMsg contains text lines representing the contents of the NNTP article including message headers.

IHAVE calls SendCmd using the NNTP IHAVE command and the 'Message-Id' header extracted from AMsg. If the server desires a copy of that article, it will return a numeric response code 335 instructing the client to send the contents of AMsg by writing the RFC contents of the message. If the server does not want the article, a numeric response indicating that the article is not wanted will be returned (435, 436, 437).

Note: IHAVE is intended for use in transferring already-posted articles between NNTP hosts. IHAVE is not normally used or permitted in NNTP client applications. IHAVE allows the NNTP message transport to perform negotiated article transmissions for articles already posted to the local NNTP host.

Some NNTP server implementations may not be able to decide immediately that an article is inappropriate for posting or forwarding, and may acknowledge the successful transfer of an article that may be subsequently discarded.


TIdNNTP.Next
TIdNNTP, See Also
Selects the next article in a newsgroup.
function Next: Boolean;
Description
Next is a method that moves an article pointer to the Next article in a newsgroup. Use SelectGroup to activate a newsgroup before calling Next.

TIdNNTP.ParseNewsGroup
TIdNNTP, See Also
Parses a newsgroup response line into variables.
procedure ParseNewsGroup(ALine: String; var ANewsGroup: String; var AHi: Integer; var ALo: Integer; var AStatus: String);
Parameters
ALine: String
Response line to be parsed.
var ANewsGroup: String
Newsgroup name from the response line.
var AHi: Integer
Highest message number from the response line.
var ALo: Integer
Lowest message number from the response line.
var AStatus: String
Posting status information for the newsgroup.
Description
ParseNewsGroup is a procedure used to parse values returned in an NNTP response that includes associated information about one or more newsgroups on the NNTP server. ParseNewsGroup is used to decode an individual response line during processing of the response from the NNTP LIST or NEWGROUPS commands as implemented in GetNewsgroupList and GetNewGroupsList.

ALine is a single line retrieved in the NNTP group response that contains the values to be parsed into the corresponding variable parameters ANewsgroup, AHi, ALo, and AStatus.

ANewsgroup is the name of a newsgroup returned in the NNTP response line.

AHi is the highest (or last) article number currently known to the newsgroup.

ALo is the lowest (or first) article number currently known to the newsgroup.

AStatus is the optional posting status information returned for the newsgroup, and normally contains the a 'y' or 'n' value. 'y' indicates that posting is allowed to the newsgroup. 'n' indicates that posting is prohibited to the newsgroup. Note: On some NNTP server implementations, a value like 'm' may occur in AStatus to indicate that moderated posting is permitted.

Parsed values in ANewsgroup, AHi, ALo, and AStatus are subsequently provided as parameters to the OnNewsgroupList and OnNewGroupsList event handlers.


TIdNNTP.ParseXOVER
TIdNNTP, See Also
Parses an XOVER response line into variables.
procedure ParseXOVER(Aline: String; var AArticleIndex: Integer; var ASubject: String; var AFrom: String; var ADate: TDateTime; var AMsgId: String; var AReferences: String; var AByteCount: Integer; var ALineCount: Integer; var AExtraData: String);
Parameters
Aline: String
Response line to be parsed.
var AArticleIndex: Integer
NNTP article number for the message.
var ASubject: String
Subject header for the article.
var AFrom: String
author of the article.
var ADate: TDateTime
posting date for the article.
var AMsgId: String
NNTP message identifier for the article.
var AReferences: String
list of message identifers for the threading hierarchy for the article.
var AByteCount: Integer
size of the article in bytes.
var ALineCount: Integer
number of lines in the body of the article.
var AExtraData: String
optional fields from LIST OVERVIEW.FMT.
Description
ParseXOVER is a procedure used to parse a line in an NNTP XOVER response, as supplied in XOver, into variables. ParseXOVER will separate the information from the article OVERVIEW database in ALine into the corresponding variable parameters.

AArticleIndex is the NNTP article number for the message.

ASubject is the subject header for the article.

AFrom is the author of the article.

ADate is the posting date for the article. Note: ADate is converted from GMT to a representation in the the local timezone during parsing.

AMsgId is the NNTP message identifier for the article.

AReferences is a list of message identifers that indicate the threading hierarchy for the article.

AByteCount is the size of the article in bytes.

ALineCount is the number of lines in the body of the article.

AExtraData contains optional fields as indicated by the NNTP LIST OVERVIEW.FMT command.

ParseXOver can be used in the OnNewNewsList event handler when the NNTP client needs to examine individual elements returned in an XOver response line.


TIdNNTP.Post
TIdNNTP, See Also
Transmits a new article to the NNTP server.
procedure Post(AMsg: TIdMessage); overload;
procedure Post(AStream: TStream); overload;
Parameters
AMsg: TIdMessage
Message instance to be sent to the NNTP server.
AStream: TStream
Stream containing the message to be sent to the NNTP server.
Description
Post is an overloaded procedure in TIdNNTP that allows the NNTP client to send a new article to the NNTP server. Post sends message content presented in the format specified by RFC 850, including required header and body lines for the message, using the conventions required for the NNTP protocol.

Post calls SendCmd using the NNTP POST command to request a posting transaction on the the NNTP server. When the numeric response code from the server is 440, posting is prohibited on the server or newsgroup. When the server response is 340, posting is allowed on the newsgroup. When posting is allowed, Post will send message data using the AMsg or AStream argument provided to the method.

When AMsg is used as the source for message data, Post will insure that the TIdMessage.ExtraHeaders property contains the value of Newsagent in the 'X-Newsreader' message header. The TIdMessage in AMsg is sent to the server using SendMsg.

When AStream is used as the source for message data, Post will send the content of the stream to the server using WriteStream.

Numeric response code 240 indicates that the article was successfully posted to the NNTP server.


TIdNNTP.Post
TIdNNTP, See Also
Transmits a new article to the NNTP server.
procedure Post(AMsg: TIdMessage); overload;
procedure Post(AStream: TStream); overload;
Parameters
AMsg: TIdMessage
Message instance to be sent to the NNTP server.
AStream: TStream
Stream containing the message to be sent to the NNTP server.
Description
Post is an overloaded procedure in TIdNNTP that allows the NNTP client to send a new article to the NNTP server. Post sends message content presented in the format specified by RFC 850, including required header and body lines for the message, using the conventions required for the NNTP protocol.

Post calls SendCmd using the NNTP POST command to request a posting transaction on the the NNTP server. When the numeric response code from the server is 440, posting is prohibited on the server or newsgroup. When the server response is 340, posting is allowed on the newsgroup. When posting is allowed, Post will send message data using the AMsg or AStream argument provided to the method.

When AMsg is used as the source for message data, Post will insure that the TIdMessage.ExtraHeaders property contains the value of Newsagent in the 'X-Newsreader' message header. The TIdMessage in AMsg is sent to the server using SendMsg.

When AStream is used as the source for message data, Post will send the content of the stream to the server using WriteStream.

Numeric response code 240 indicates that the article was successfully posted to the NNTP server.


TIdNNTP.Previous
TIdNNTP, See Also
Moves to the previous article in a newsgroup.
function Previous: Boolean;
Description
Previous is a procedure used to moves the current article pointer to the previous article in a newsgroup. Use SelectGroup to activate a newsgroup before using the Previous method.

TIdNNTP.SelectArticle
TIdNNTP, See Also
Sets the current article pointer in the newsgroup.
function SelectArticle(const AMsgNo: Integer): Boolean;
Parameters
const AMsgNo: Integer
Message number to be selected in the current article pointer.
Description
SelectArticle is a Boolean function that sets the current article pointer to the message number specified in AMsgNo. SelectArticle calls SendCmd using the NNTP STAT command to select the requested article by the specified message number.

Use SelectGroup to activate a specific newsgroup prior to using SelectArticle.


TIdNNTP.SelectGroup
TIdNNTP, See Also
Selects the active newsgroup on the NNTP server.
procedure SelectGroup(const AGroup: string);
Parameters
const AGroup: string
Group to make the active newsgroup.
Description
SelectGroup is a procedure used to make the newsgroup specified in AGroup the active newsgroup on the NNTP server. SelectGroup calls SendCmd using the NNTP GROUP command to activate the newsgroup requested in AGroup. SelectGroup parses the values in the NNTP server response to determine the values for the MsgCount, MsgLow, and MsgHigh properties.

Use SelectGroup prior to retrieving articles from the NNTP server.


TIdNNTP.SendCmd
TIdNNTP, See Also
Executes NNTP commands verbs.
function SendCmd(const AOut: string; const AResponse: Array of SmallInt): SmallInt; override;
Parameters
const AOut: string
NNTP command to be executed.
const AResponse: Array of SmallInt
Array of anticipated numeric response codes. An empty array ([]) indicates that no response code is expected.
Return Value
SmallInt - Response code returned from either the NNTP send command.
Description
SendCmd is an overriden SmallInt function in TIdNNTP. SendCmd calls the inherited SendCmd method using an empty array indicating no expected response codes. SendCmd extends the ancestor method by implementing User and Password authentication using the NNTP AUTHINFO service extension when the response code returned by TIdTCPConnection.SendCmd is either 450 or 480, as described in the Internet Standards document:

  • RFC 2980 - Common NNTP Extensions (http://www.rfc-rditor.org/rfc/rfc2980.txt)

SendCmd performs default error handling by calling CheckResponse. An EIdResponseError exception will be raised when a valid response is expected and the result, from either the inherited SendCmd or from the authentication of User and Password information, does not match the expected response code(s).


TIdNNTP.TakeThis
TIdNNTP, See Also
Performs non-negotiated article transmissions.
function TakeThis(const AMsgID: string; AMsg: TStream): string;
Parameters
const AMsgID: string
ASCII contents of the message(s) to send. AMsg -
Return Value
String - Textual response from the NNTP server.
Description
TakeThis is a string function used to perform non-negotiated NNTP article transmission for a stream containing the headers and body of a news article. TakeThis is similar to IHAVE, except that no server response is expected after article transmission.

AMsgID contains the message identifer for the news article to be transmitted. AMsg is a stream containing the contents of the news article including message headers and body.

TakeThis calls SendCmd using the value in AMsgID to begin streaming article transmission. TakeThis writes the message contents in AMsg to the server using WriteStream.


TIdNNTP.XHDR
TIdNNTP, See Also
NNTP extension to retrieve article headers using selection criteria.
procedure XHDR(const AHeader: string; const AParam: string; AResponse: TStrings);
Parameters
const AHeader: string
Header to be searched.
AResponse: TStrings
Server response.
AParm
Range of articles to search.
Description
XHDR is a method that retrieves specific article headers specified in AHeader from an article index or a range of articles as specified in AParam. XHDR is an extension to the NNTP protocol. XHDR calls SendCmd using the arguments in AHeader and AParam. XHDR calls Capture to store the server response lines in AResponse.

AHeader can contain any of the following values for an RFC 1036-compliant server:

  • From

  • Date

  • Newsgroups

  • Subject

  • Message-ID

  • Path

The following headers may or may not work depending on the server configuration. Also, it should be noted that servers can and many do have local header definitions. If you know what these header designations are you can of course pass them in the AHeader argument.

  • Reply-To

  • Sender

  • Followup-To

  • Expires

  • References

  • Control

  • Distribution

  • Organization

  • Keywords

  • Summary

  • Approved

  • Lines

  • Xref

The range of articles to be searched is specifies by the AParm argument. AParm must be in the following forms:

  • an article number

  • an article number followed by a dash to indicate all following

  • an article number followed by a dash followed by another article number

For example, if the following values of AParm would result in the corresponding action:

  • 23 would retrieve article number 23.

  • 1-23 would retrieve all available articles number in the range 1 through 23.

  • 23- would retrieve all articles numbered 23 and higher.

Note: Article numbers are transitory. This means that you may specify a range of article numbers, such as 1-5, and you may receive only articles 1,3 and 4. This does not mean you have done anything wrong. The missing articles may have been expired (removed from the server), or for some other reason not under your control have become unavailable.

The response(s) from the server are stored in AResponse. Note: You must have previously executed the SelectGroup command in order for this command to return a meaningful response.


TIdNNTP.XOVER
TIdNNTP, See Also
Retrieve information from an article overview database.
procedure XOVER(const AParam: string; AResponse: TStrings); overload;
procedure XOVER(const AParam: string; AResponse: TStream); overload;
Parameters
AResponse: TStrings
Textual responses for each article.
AParm
Article(s) to send.
Description
XOVER is a procedure that retrieves information from an article overview database maintained on most news-servers and places the results in AResponse.

AParm can be an article index such as "1", an article index followed by a dash to indicate the index and all articles following it such as "1-", or a range of articles such as "1-10".

You can parse the results using the ParseXOVER procedure in the IdNNTP unit. You sometimes can parse for additional information by getting the format of the overview database with the GetOverviewFMT method.

You have to use SelectGroup to select the newsgroup before using this method.


TIdNNTP.XOVER
TIdNNTP, See Also
Retrieve information from an article overview database.
procedure XOVER(const AParam: string; AResponse: TStrings); overload;
procedure XOVER(const AParam: string; AResponse: TStream); overload;
Parameters
AResponse: TStrings
Textual responses for each article.
AParm
Article(s) to send.
Description
XOVER is a procedure that retrieves information from an article overview database maintained on most news-servers and places the results in AResponse.

AParm can be an article index such as "1", an article index followed by a dash to indicate the index and all articles following it such as "1-", or a range of articles such as "1-10".

You can parse the results using the ParseXOVER procedure in the IdNNTP unit. You sometimes can parse for additional information by getting the format of the overview database with the GetOverviewFMT method.

You have to use SelectGroup to select the newsgroup before using this method.


TIdNNTP.OnNewNewsList
TIdNNTP, See Also
Event handler signalled on receipt of values in the new articles list.
property OnNewNewsList: TEventNewNewsList;
Parameters
ACanContinue
False to stop new article retrieval.
AMsgID
Message identifier for the article.
Description
OnNewNewsList is a TEventNewNewsList property that represents the event handler signalled on receipt of values in the new articles list from GetNewNewsList. OnNewNewsList is used when GetNewNewsList is called without a TStrings argument used as the destination of the new article listing. OnNewNewsList will be triggered once for each article received in a response line from the NNTP server in GetNewNewsList.

Applications must assigned a procedure to the event handler when TStrings is not used to store the new article listing. If the event handler is unassigned, an EIdNNTPNoOnNewNewsList exception will be raised. The event handler can be used to update display or storage aspects of the NNTP client when new articles message identifiers are received. Setting ACanContinue to False stops retrieval of the new article list.


TIdNNTP.OnNewsgroupList
TIdNNTP, See Also
Event handler signalled on receipt of values in the newsgroup list.
property OnNewsgroupList: TEventNewsgroupList;
Parameters
ACanContinue
False to stop newsgroup list retrieval.
AHigh
Highest index number for an available article.
ALow
Lowest index number for an available article.
ANewsgroup
Name of the newsgroup.
AType
Posting status of the newsgroup.
Description
OnNewsgroupList is a TEventNewsGroupList property that represents the event handler triggered when values in the newsgroup list are retrieved using the GetNewsgroupList method. OnNewsgroupList is used when GetNewsgroupList is called without a TStrings destination for the newsgroup listing. OnNewsgroupList will be triggered once for each newsgroup response line retrieved and processed in GetNewsgroupList.

Applications must assigned a procedure to the event handler when TStrings is not used to store the newsgroup listing. If the event handler is unassigned, a EIdNNTPNoOnNewsgroupList exception will be raised. The event handler can be used to update the stored newsgroup list on the NNTP client using values in the event handler arguments. Setting ACanContinue to False stops the newsgroup retrieval.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.