If you're restricted to using "mail", then you can use uuencode to encode the file. I think the modern mail clients still support uunecode :)
uuencode file.jpg file.jpg | mail -s "pic" "[email protected]"
File named is passed twice (first is the local file to be encoded and second is the file name as it will be extracted on the remote system).
Otherwise, you can use mutt or metamail to send MIME encoded mails. You can use both from command line.
The best way to do this is generally to use mutt instead:
mutt is available on most unix-like platforms these days and usually comes installed in the base OS.
Your other option is to uuencode the file and send it through mail:
as explained here.
can try
atleast with gnus mailutils see http://mailutils.org/manual/html_section/mail.html
If you're restricted to using "mail", then you can use uuencode to encode the file. I think the modern mail clients still support uunecode :) uuencode file.jpg file.jpg | mail -s "pic" "[email protected]" File named is passed twice (first is the local file to be encoded and second is the file name as it will be extracted on the remote system).
Otherwise, you can use mutt or metamail to send MIME encoded mails. You can use both from command line.