#!/usr/bin/perl use IO::Socket; use strict; my($remote_host, $sender, $recipient, $remote_port, $line, $response, $socket, $flag); $remote_host = "localhost"; $remote_port = 10028; $socket = IO::Socket::INET->new(PeerAddr => $remote_host, PeerPort => $remote_port, Proto => "tcp", Type => SOCK_STREAM) or die "Couldn't connect to $remote_host:$remote_port : $@\n"; ## print $socket "HELO localhost\n"; print $socket "HELO $remote_host\n"; $response = <$socket>; my $skip = shift; $skip=shift; $sender = shift(@ARGV); $sender =~ s/\-f//; print $socket "MAIL FROM: <$sender>\n"; $response = <$socket>; $skip=shift; while ($recipient = shift(@ARGV)) { print $socket "RCPT TO: <$recipient>\n"; $response = <$socket>; } $response = <$socket>; print $socket "DATA\n"; $response = <$socket>; while (defined($line = )) { print $socket "$line"; } print $socket "\n.\n"; $response = <$socket>; print $socket "QUIT\n"; close($socket); exit(0);