use strict; use warnings; use Mail::Sendmail; my $from = '"Company Surveys" '; my $subject = 'Your Survey'; open LIST, "; my %mails = ( From => "$from", Subject => "$subject", Message => join "", @message, ); while () { sendmail('To' => $_, %mails) or warn $Mail::Sendmail::error; print "Message has been sent to $_"; }; close LIST; close MESSAGE; print "All e-mails sent successfully.\n\n";