C Execl Telnet

This is a discussion on C Execl Telnet within the C Programming forums, part of the General Programming Boards category; Hi: I'm trying to write a C function that will send an email using Telnet. I have already both written ...

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    5

    C Execl Telnet

    Hi:

    I'm trying to write a C function that will send an email using Telnet.

    I have already both written some C functions and manually gone through the steps at a command prompt that I need Telnet to do to send an Email.

    I found a set of functions starting with EXEC that execute commands - I believe as if it were being called in a command prompt but im not sure.

    When I use the following line of code the function never completes its execution and i need to kill the application.

    execl("telnet","quit*/",NULL);

    All that this should do is start Telnet and pass a command to Telnet telling it to quit ... I tried this with different variations of characters after quit - i was trying to pass a return character because I believed that passing quit without return was like typing quit at the command prompt without pressing enter - and expecting it to execute.

    Does anyone have an idea of what I'm doing wrong?

    Does anyone know how to use Telnet from a C function?

    Thankyou,
    Karl

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,163
    Instead of using execl() try using popen() so you can send commands to telnet.
    If you understand what you're doing, you're not learning anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with telnet and tcp
    By hoAx in forum Windows Programming
    Replies: 11
    Last Post: 03-11-2008, 02:03 PM
  2. C Function Telnet Email
    By karcheee in forum C Programming
    Replies: 3
    Last Post: 07-25-2005, 11:39 AM
  3. telnet!!
    By bigB8210 in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-13-2003, 05:09 PM
  4. recv() and telnet ?
    By Devil Panther in forum Windows Programming
    Replies: 4
    Last Post: 06-13-2003, 12:23 PM
  5. execl failing
    By carrythe0 in forum C Programming
    Replies: 1
    Last Post: 10-01-2001, 12:25 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21