sub ... { # stuff to parse the email my %params = ... my $msg = MIME::Lite->new (%params); my $result = eval {$msg->send}; }