my $mailer = "/path/to/mailer"; open(MAIL, " | $mailer") || die ("Can't open PIPE to mailer: $mailer ($!)\n"); print MAIL <<'EOF'; To: you@yourdomain.com From: "The Camel" Subject: This is your camel speaking! This is a mailbody, spoken by your camel, wearing a red-hat, being friends with penguin, called Tux EOF close(MAIL);