http://www.perlmonks.org?node_id=675600


in reply to Sending An Attachment Using Net::SMTP

You're not actually sending the contents of the file. For that, you have to open the file, read it (possibly in blocks), and send it through SMTP.

You really ought to encode it in base64 encoding, for which you'd be best off installing a module, if you don't have it already: MIME::Base64, or as a fallback measure, MIME::Base64::Perl.

The latter is in Pure Perl, you can install it by just copying it to a proper location.