#!/usr/bin/perl use strict; use warnings; $title='Test'; $to='test@mydomain.com'; $from= 'test@example.com'; $subject='Test mail'; my $file = "test.txt"; open(MAIL, "|/usr/sbin/sendmail -oi -t "); print MAIL "To: $to\n"; print MAIL "From: $from\n"; print MAIL "Subject: $subject\n\n"; print MAIL "Content-type: text/html\n\n"; open(FILE, "$file") or die "Cannot open $file: $!"; print MAIL ; close(FILE); close(MAIL);