Click to See Complete Forum and Search --> : recording response from <?system('telnet aspmx.l.google.com 25')?>


Buy
October 3rd, 2008, 11:14 AM
hi, i'm trying to make a script to validate email addresses. i start with:

<?getmxrr('birminghampr.co.uk',$mxhosts);

then i try: $x=system("telnet $mxhosts[0] 25", $y);

...and 3 lines are printed:

Trying 64.233.183.27...
Connected to ASPMX.L.GOOGLE.COM.
Escape character is '^]'.

while $x becomes the last line generated by the system... 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: 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.

PeejAvery
October 3rd, 2008, 04:04 PM
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.

Buy
October 4th, 2008, 02:47 AM
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?