Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Back to basics...connecting with TcpClient?

Status
Not open for further replies.

JaybOt

Programmer
Apr 18, 2001
101
GB
Hi all,

I am trying to use TcpCliet to create a small application to conect to my server (FreeBSD Unix) on port 25 (im not trying to send email, just using it for testing). I am used to doing this with Unix TCP sockets (c++) but with windows (XP) (c++ builder) I cant quite get the TcpClient component to work correctly.

I have used TcpClient in the past, but cant remember how to implement the 'onXxxxx' methods?? Or maybe im mixing Unix C++ with Builder code??? My form just has a memo box (connection window), an edit box (4 sending), and 3 buttons - connect, disconnect, and send (to send text)

I can get the server SMTP welcome message (i.e. ESMTP Sendmail vblah.. blah ..blah) but cannot send the "helo me" message? when i click the 'send' button, nothing appears to happen? I have used TcpClient->Socket->ReceiveText() and SendText() to do this so far, but have no real idea how to use them correctly - any success i've had has been based on prior knowledge of socket! Or are the problems im having because i am connection to a Unix system?

If anyone Can tell me how i should go about doing this with either TcpClient->Socket or another componet (or method) i would be more than grateful. I just need to know the easiest/best way to use/do this in my current situation, and how it should be implemented (which 'onXxx' methd should contain what code).

A small example would also be most welcome.

Regards,
J@yb0t[afro]

"Always know what you say, but don't always say what you know!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top