What's wrong with this SMTP dialog?
Posted
by Alix Axel
on Stack Overflow
See other posts from Stack Overflow
or by Alix Axel
Published on 2010-05-01T18:06:25Z
Indexed on
2010/05/01
18:07 UTC
Read the original article
Hit count: 555
I'm running some tests with the Gmail SMTP, for some reason my script is hanging at this point:
fwrite($smtp, 'DATA' . "\n");
$result[7] = trim(fgets($smtp));
$result[7] = substr($result[7], 0, 3); // 354
// the script starts hanging here
fwrite($smtp, 'From: "Alix Axel" <[email protected]>' . "\n");;
fwrite($smtp, 'To: "Alix Axel" <[email protected]>' . "\n");
fwrite($smtp, 'Date: Tue, 15 May 2010 18:50:00 -0000' . "\n")
fwrite($smtp, 'Subject: Testing SMTP' . "\n");
fwrite($smtp, '' . "\n");
fwrite($smtp, 'Helo SMTP!' . "\n");
fwrite($smtp, "\n.\n" . "\n");
$result[8] = trim(fgets($smtp));
$result[8] = substr($result[8], 0, 3); // 250
Why is this happening?
© Stack Overflow or respective owner