my $ciphertext = $pgp->encrypt( Filename => $file, Recipients => $key_id, Armour => 1, ); #### use Mail::Sender; $sender = new Mail::Sender {smtp => 'mail.yourdomain.com', from => 'your@address.com'}; $sender->MailFile({to => 'some@address.com', subject => 'Here is the file', msg => "I'm sending you the list you wanted.", file => 'filename.txt'});