I
Iceberg
Hi, I'm using ActivePerl on Win98 and this is starting to annoy me.
Why isn't \n accepted as a carriage return when I'm using sockets?
If I run the following program, I get no response other than the SMTP info
header. Using a proxy to investigate, I found that what is getting sent to
the server is only an 0a character not an 0d0a sequence, any help on this
would be great appreciated. I've already tried sending \r\n and that makes
no difference.
#!/usr/bin/perl -w
use IO::Socket;
$remote = IO::Socket::INET->new(
Proto => "tcp",
PeerAddr => "smtp_host",
PeerPort => "25",
)
or die "cannot connect to server";
# get SMTP server welcome
$line=<$remote>;
print "$line\n";
# send HELO
print $remote "HELO\n"; # the \n here doesn't seem to work
# get reply
$line=<$remote>;
print "$line\n";
Why isn't \n accepted as a carriage return when I'm using sockets?
If I run the following program, I get no response other than the SMTP info
header. Using a proxy to investigate, I found that what is getting sent to
the server is only an 0a character not an 0d0a sequence, any help on this
would be great appreciated. I've already tried sending \r\n and that makes
no difference.
#!/usr/bin/perl -w
use IO::Socket;
$remote = IO::Socket::INET->new(
Proto => "tcp",
PeerAddr => "smtp_host",
PeerPort => "25",
)
or die "cannot connect to server";
# get SMTP server welcome
$line=<$remote>;
print "$line\n";
# send HELO
print $remote "HELO\n"; # the \n here doesn't seem to work
# get reply
$line=<$remote>;
print "$line\n";