#!/usr/bin/perl use strict; use warnings; my $sendmail_path = '/usr/sbin/sendmail'; # or whatever the path to sendmail is my $to = 'test@test.example'; # your own mail address my $from = 'test2@test.example'; my $subject = 'Test'; my $body = 'Testnachricht'; open MAIL, "| $sendmail_path -oi -t" or die $!; print MAIL qq~To: $to From: $from Subject: $subject $body~; close MAIL;