NewsGroups
property NewsGroups: TStrings read write;
Example
procedure AddressNewsMessage;
var
Msg: TIdMessage;
begin
Msg := Email;
if Msg = nil then Exit;
Msg.NewsGroups.Clear;
Msg.NewsGroups.Add('example.technical');
Msg.NewsGroups.Add('example.integrations');
end;
Usage
Exposes the message-owned list projected to and from the comma-separated Newsgroups header without validating group names or destinations.
Additional Technical Info
NewsGroups returns the live TStringList owned by the message. Use it for NNTP newsgroup names; it is independent of email recipient collections. The message creates and frees the list, so scripts must not free it or retain it beyond the message/action lifetime.
Assigning another TStrings calls NewsGroups.Assign(value) and copies its content into the existing owned list. It does not replace the object. Direct Clear, Add, Delete, Text and indexed operations mutate the live list. A nil assignment is not guarded.
GenerateHeader serializes the list through CommaText into the Newsgroups header. ProcessHeaders parses that header back into the list with Indy's comma-separated helper. Whitespace and quoting are therefore interpreted as list syntax rather than preserved byte-for-byte.
No setter validates NNTP group grammar, server availability, access rights, duplicates or whether the current Velox action actually posts news. Empty input clears the generated header value. ClearHeader clears the list, and loading replaces it from parsed headers after the message-wide clear.
Treat values as externally supplied addressing data: validate them against the intended server/policy before use and avoid logging confidential routing details unnecessarily. The example is fictional and source-reviewed; it did not connect to an NNTP server.
External references
- Indy upstream:
IdMessage.pas- owned list, header projection and parsing. - Embarcadero DocWiki:
System.Classes.TStrings.CommaText- Delphi comma-list serialization. - Free Pascal:
TStrings.CommaText- compatible list reference; Velox uses Delphi. - RFC 5536, Newsgroups header - Internet news message field semantics.