“When the need arises to send email from the command line, many
folks first think of the mail(1) command. A better choice might be
the email program, which gives you the ability to send email to an
SMTP server over SSL, offers MIME support including ability to
attach one or more files to your emails, uses an address book to
store your recipients, and lets you digitally sign and encrypt your
messages.“While there are tools to allow you to send complex email
messages from Perl or PHP, being able to send email directly from
the command line is handy for cron jobs and other applications
where you just want to quickly send a message with an
attachment…”