Here is a simple script that will send a test email using Net::SMTP from somewhere to a recipient.

   
#!/usr/local/bin/perl
    use Net::SMTP;
    #Vars
    $to_email = 'recipient@foo.com';
    $from_email = 'sender@foo.com';
    $mail_server = "127.0.0.1";
    $smtp = Net::SMTP->new("$mail_server");
    $smtp->mail ("$from_email");
    $smtp->to("$to_email");
    $smtp->data();
    $smtp->datasend("From: $from_email\n");
    $smtp->datasend("To: $to_email\n");
    $smtp->datasend("Subject: test message\n");
    $smtp->datasend("\n");
    $smtp->datasend("A simple test message\n");
    $smtp->dataend();
    $smtp->quit;

This is handy as a subroutine in a script that you would want to notify you of some value. In order to use it that way, you would change the test message datasend field to a variable containing some information from another section of your script.