#!/usr/bin/perl
use strict;
use Mail::Mailer;
my $mailer = Mail::Mailer->new('smtp', Server => 'smtp.myserver.com');
$mailer->open( { 'To' => 'me@mydomain.com',
'Subject' => 'Test Message',
'From' => 'Me ' } );
print {$mailer} "Hello world\n";
$mailer->close or die ("Couln't close: $!");