---

About.com: Mailing From Scripts

“The old Unix mailer at /bin/mail is one of the programs that
really helped to launch the Internet as we know it today. In days
gone by, it was one of the most used binaries on any Unix
workstation. Today, the /bin/mail binary can still be used, but
is horribly outdated — it’s a text-only mailer with almost no
features at all.”

“It is good, however for one thing: automated mailing, such
as sending e-mail from a shell script.
To send mail with the
/bin/mail program, use this syntax:

    mail -s "subject" touser@address < body_text


Complete Story

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis