What's wrong with this SMTP dialog?
- by Alix Axel
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?