🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
4 messages
4 total messages Started by simon taylor Fri, 02 Aug 2002 10:58
simple post syntax problem
#59807
Author: simon taylor
Date: Fri, 02 Aug 2002 10:58
36 lines
1891 bytes
Dear all,
Firstly thank you for reading my post - I can appreciate your very
busy !!!
My question should be quite simple... but I cannot find any help
anywhere....

I'm using the winsck.ocx control as the basis of a light weight
posting application written in vb

I can connect to our IIS/NNTP server no problem eg....

"Winsock1.Connect "server.com", 119"

and i can read postings ok....
"Winsock1.SendData "ARTICLE 1" & vbCrLf"

but when I try and post i just get a "Command not recognised"
I know there are no permissions problems...

heres what I have tried......

Winsock1.SendData "POST"
winsock1.sendData "Newsgroup: test "
Winsock1.SendData "From: me@company.com  "
Winsock1.SendData "Subject:NNTP Demo Post "
winsock1.senddata " "
Winsock1.SendData "This is an NNTP posting demonstration"
Winsock1.SendData "." & vbCrLf

also put all the above on one line with one long Winsock1.sendData
command !

What am I doing wrong any help would be much appreciated......
Thanks
simon.
Re: simple post syntax problem
#59809
Author: Erik Hensema
Date: Fri, 02 Aug 2002 11:26
44 lines
2445 bytes
simon taylor (simon.taylor@fdlearning.com) wrote:
> Dear all,
> Firstly thank you for reading my post - I can appreciate your very
> busy !!!
> My question should be quite simple... but I cannot find any help
> anywhere....
> 
> I'm using the winsck.ocx control as the basis of a light weight
> posting application written in vb
> 
> I can connect to our IIS/NNTP server no problem eg....
> 
> "Winsock1.Connect "server.com", 119"
> 
> and i can read postings ok....
> "Winsock1.SendData "ARTICLE 1" & vbCrLf"
> 
> but when I try and post i just get a "Command not recognised"
> I know there are no permissions problems...
> 
> heres what I have tried......
> 
> Winsock1.SendData "POST"

Pause here and wait for the server's reply

> winsock1.sendData "Newsgroup: test "
> Winsock1.SendData "From: me@company.com  "
> Winsock1.SendData "Subject:NNTP Demo Post "
> winsock1.senddata " "

This should be an empty line.

> Winsock1.SendData "This is an NNTP posting demonstration"
> Winsock1.SendData "." & vbCrLf

What is vbCrLf? A CR+LF? You'll have to add that to every line.

The & operator isn't bitwise AND, but string concatination, I hope? ;-)

-- 
Erik Hensema (erik@hensema.net)                             ICQ# 8280101
Quoting-HOWTO: http://www.leerquoten.nl
Re: simple post syntax problem
#59811
Author: Greg Andrews
Date: Fri, 02 Aug 2002 23:46
31 lines
1965 bytes
simon.taylor@fdlearning.com (simon taylor) writes:
>
>Winsock1.SendData "POST"
>

Aren't you supposed to send the POST command, followed by
a CR and LF, then read the server's reply before you
start sending the article?

>winsock1.sendData "Newsgroup: test "
>Winsock1.SendData "From: me@company.com  "
>Winsock1.SendData "Subject:NNTP Demo Post "
>winsock1.senddata " "
>Winsock1.SendData "This is an NNTP posting demonstration"
>Winsock1.SendData "." & vbCrLf

Does this indicate that the line "Newsgroup: test " did not
and in a CR and LF?  That the only CR and LF appeared at the
end of the "." line?

If I understand the above correctly, then you're sending your
entire article as a single line rather than multiple lines.
That would be a problem.  Articles are transmitted as multiple
lines rather than just one.

  -Greg
-- 
:::::::::::::  Greg Andrews  :::::  gerg@panix.com  :::::::::::::
     I have a map of the United States that's actual size.
				-- Steven Wright
Re: simple post syntax problem
#59844
Author: simon taylor
Date: Mon, 05 Aug 2002 13:24
55 lines
2568 bytes
Erik/Greg

Thanks for your replies - they where both spot on :)

For anyone else who is interested heres a code snippet that does the business:

Winsock1.SendData "POST " & vbCrLf
'Wait for reply from server
    
Winsock1.SendData "Newsgroups:  " & NameOfNewsGroup & vbCrLf
Winsock1.SendData "Subject: " & TheSubject & vbCrLf
Winsock1.SendData "From:  " & ThePersonWhoIsSending & vbCrLf
Winsock1.SendData vbCrLf
Winsock1.SendData TheBodyOfTheMessage & vbCrLf
Winsock1.SendData "." & vbCrLf

'You should get a confirmation notice from the server at this point !

& is a string concaternation :)

cheers
simon.





gerg@panix.com (Greg Andrews) wrote in message news:<aif5js$qab$1@reader2.panix.com>...
> simon.taylor@fdlearning.com (simon taylor) writes:
> >
> >Winsock1.SendData "POST"
> >
> 
> Aren't you supposed to send the POST command, followed by
> a CR and LF, then read the server's reply before you
> start sending the article?
> 
> >winsock1.sendData "Newsgroup: test "
> >Winsock1.SendData "From: me@company.com  "
> >Winsock1.SendData "Subject:NNTP Demo Post "
> >winsock1.senddata " "
> >Winsock1.SendData "This is an NNTP posting demonstration"
> >Winsock1.SendData "." & vbCrLf
> 
> Does this indicate that the line "Newsgroup: test " did not
> and in a CR and LF?  That the only CR and LF appeared at the
> end of the "." line?
> 
> If I understand the above correctly, then you're sending your
> entire article as a single line rather than multiple lines.
> That would be a problem.  Articles are transmitted as multiple
> lines rather than just one.
> 
>   -Greg
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads