CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2007
    Posts
    9

    Thumbs up recording response from <?system('telnet aspmx.l.google.com 25')?>

    hi, i'm trying to make a script to validate email addresses. i start with:

    Code:
    <?getmxrr('birminghampr.co.uk',$mxhosts);
    then i try:
    Code:
    $x=system("telnet $mxhosts[0] 25", $y);
    ...and 3 lines are printed:

    Code:
    Trying 64.233.183.27...
    Connected to ASPMX.L.GOOGLE.COM.
    Escape character is '^]'.
    while $x becomes the last line generated by the system...
    Code:
    Escape character is '^]'.
    ...while $y becomes the number "1" to say something like it was a good command.... but if i try to manually "telnet aspmx.l.google.com 25" i get an additional response banner as the 4th line:
    Code:
    220 mx.google.com ESMTP i4si16*********.1
    ...now what i need to do is somehow grab this 4th line using PHP! any ideas anyone? any help would be very much appreciated.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: recording response from <?system('telnet aspmx.l.google.com 25')?>

    What are the differences between your server and the client? If they are not the same machine, or do not run the same OS, then the telnet application might be different as well.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Jan 2007
    Posts
    9

    Re: recording response from <?system('telnet aspmx.l.google.com 25')?>

    to be honest i'm quite a newbie at linux commands... i only managed the above with a lot of help. is there some command i can type in to get the particular info you've asked for from each server?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured