This is how far I've come by following the instructions on this page.
PHP Code:
<?php
function writeln($input) {
echo htmlentities($input) . '<br />' . "\n";
}
// open a new socket
$socket = fsockopen('mail1.telia.com', 25, $errno, $errstr, 30 );
// define the sender
echo '<p>';
$command = "MAIL FROM:<erik@riklund.org>\r \n";
writeln( $command );
fputs( $socket, $command );
writeln( fgets( $socket, 128 ) );
echo '</p>';
// define the recipient
echo '<p>';
$command = "RCPT TO:<erik_riklund@hotmail.com> \r\n";
writeln( $command );
fputs( $socket, $command );
writeln( fgets( $socket, 128 ) );
echo '</p>';
?>
The result:
Code:
MAIL FROM:<erik@riklund.org>
220 smtp2-1-sn4.m-sp.skanova.net ESMTP Postfix
RCPT TO:<erik_riklund@hotmail.com>
503 Error: need MAIL command
What might be wrong?
-- lilleman
Bookmarks