#!/usr/bin/perl use strict; use IO::Socket::INET; print "Content-Type: text/plain\n\n"; my $sock = new IO::Socket::INET( Proto=>"tcp", PeerAddr=>"localhost", PeerPort=>25); die ("no connection possible") unless defined $sock; chomp(my $hostname = `hostname`); print $sock "HELO $hostname\n"; print $sock "MAIL FROM: \n"; print $sock "QUIT\n"; print "Server sagt:\n"; print while <$sock>; $sock -> close();