You would need to install sharutils
sudo apt-get install sharutils
Then run this
uuencode <path_to_file> <name_to_give_attachment> | mail -s "Subject" foo@example.com
Also see http://soamweird.blogspot.com/2016/03/sending-mail-in-unix.html