[Lazarus] help with NNTP posting
duilio foschi
octopushole at gmail.com
Wed Nov 20 21:18:28 CET 2024
solved.
from
https://www.w3.org/Protocols/rfc977/rfc977.html
3.10. The POST command
...
The text forming the header and body of the message to be posted
should be sent by the client using the conventions for text received
from the news server: A single period (".") on a line indicates the
end of the text, with lines starting with a period in the original
text having that period doubled during transmission.
This code works ok:
var
alist:TStringlist // initialized elsewhere
alist.Clear;
aList.Add('POST');
aList.Add('From: "peppepolpo" <octopushole at gmail.com>');
aList.Add('Newsgroups: it.hobby.fai-da-te');
aList.Add('Subject: test 201937');
aList.Add('Organization: None');
aList.Add('X-Newsreader: DIY component ');
{ End of header is a blank line }
aList.Add('');
{ Write the message body }
aList.Add('');
aList.Add('test 201937');
aList.Add('.'); // <<<<<<<<<<<<<<<<<<<<<<<<<<< this was missing!
a:=aclient.SendMessage(alist.Text);
On Wed, Nov 20, 2024 at 8:37 AM Marcus Sackrow via lazarus <
lazarus at lists.lazarus-ide.org> wrote:
> Am 20.11.2024 um 08:34 schrieb Marcus Sackrow via lazarus:
> >> LineToStream('"peppepolpo" <octopushole at gmail.com>');
> >>
>
> just noticed here is also the 'From:' missing!
>
> LineToStream('From: "peppepolpo" <octopushole at gmail.com>');
>
> --
> _______________________________________________
> lazarus mailing list
> lazarus at lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20241120/9027f0ff/attachment.htm>
More information about the lazarus
mailing list