use Mail::Sender::Easy qw(email); print "Enter the From address with comma separator\n"; chomp ($from = ); print "Enter the To address with comma separator\n"; chomp ($to = ); print "Enter the cc address with comma separator\n"; chomp ($cc = ); print "Enter the bcc address with comma separator\n"; chomp ($bcc = ); print "Enter the subject\n"; chomp ($sub = ); print "Enter the body part\n"; chomp ($text = ); email({ 'from' => "$from", 'to' => "$to", 'cc' => "$cc", 'bcc' => "$bcc", 'subject' => "$sub", 'priority' => 2, # 1-5 high to low 'confirm' => 'delivery, reading', 'smtp' => '192.168.1.5', 'port' => 25, #'auth' => 'LOGIN', #'authid' => 'foo@bar.baz', 'authpwd' => 'protect_with_700_perms_or_get_it_from_input', '_text' => "$text" }) or die "email() failed: $@";