Jump to content

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


Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/126910-recording-response-from/
Share on other sites

hi corbin, thanks for the reply. i normally use file_get_contents and file_put_contents, sometimes curl, and sometimes file()... but i've never used these socket functions before

 

is there any chance you could give me some example code of how to a "telnet aspmx.l.google.com 25" and record the response?

  • 1 month later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.