Command line: Sending a zip file via e-mail
The quick and dirty way to send an attachment is to uuencode the file and mail it.


uuencode report.pdf report.pdf | mail -s "Here is the report" bossman@company.com


If you want to do it easily and build a proper MIME encoded message, you could install mutt, and use the -a flag to attach your message. 

If you don't want to install anything else, you could build your own MIME message by hand, or use the perl MIME::Entity module to help you:


#!/usr/bin/perl
use MIME::Entity;

$message = MIME::Entity->build(
  Type    => "multipart/mixed",
  From    => "me\@company.com",
  To      => "bossman\@company.com",
  Subject => "Report attached" );

$message->attach(Data=>"Here is the report, as promised.");

$message->attach(
  Path     => "./report.pdf",
  Type     => "application/pdf",
  Encoding => "base64");

open MAIL, "| /usr/sbin/sendmail -t -oi";
$message->print(\*MAIL);
close MAIL;