#!/usr/local/bin/perl use strict; use warnings; use Mail::Mailer; my %headers = ( 'To' => 'foo@bar.com', 'From' => 'bar@foo.com', 'Subject' => 'test' ); my $body = "Test Test"; my $mailer = new Mail::Mailer 'sendmail'; $mailer->open(\%headers); print $mailer $body;