use strict; use Net::SMTP; use FileHandle; my $smtp = Net::SMTP->new('mailhost', Hello => 'exchange.cognos.com', Timeout => 30, Debug => 1, ); my $fh_email_title= new FileHandle; $fh_email_title->open("< email_title.txt") or die "Cannot open email title file: $!"; my $fh_email_content= new FileHandle; $fh_email_content->open("< email_content.txt") or die "Cannot open email content file: $!"; $smtp->mail('travis.weir@cognos.com'); $smtp->to('travis.weir@cognos.com'); $smtp->???($fh_email_title->getlines()); $smtp->data(); $smtp->datasend($fh_email_content->getlines()); $smtp->dataend(); $fh_email_title->close; $fh_email_content->close; $smtp->quit; autoflush STDOUT 1;