Help for this page
my $MailText = ''; open MAILOUT, '>', \$MailText or die "open in-memory output: $!"; ... # ... close MAILOUT; select STDOUT; # $MailText now contains "foo\nbar\n"; send it however you want