in reply to Sub routine used to send a mail

I prefer to use MIME::Lite just to make life easier, following is a short sample:
use MIME::Lite; my $msg = MIME::Lite->new( From => $from_address, To => $to_address, Subject => 'Hello world', Data => 'some body text' ); $msg->send;
This can of course be incorporated into a sub if required.

Update: fixed some obvious syntax errors (well, obvious after a cup o' joe ;)