How can the 'mail' command be used? I've had my first Mac for about five months now. Though, even when I was a full-on Windows user, I never did things through a command line; I was pretty much for the GUI all-the-way..

But now that I have my Mac, I'm interested in learning a little about the Terminal and the commands used in it. So far I've learned how to do minor things, like moving, renaming, and deleting files, ect. But now I want to go for something different, like the mail command.

So tonight I figured out how to send mail to myself through the 'mail' command. But now I'm curious and asking if there's a way to send e-mail to people using say, Yahoo or Hotmail.

Sorry if this is a basic question, but I'm new and curious. Thanks.
It you want to send an email to a given address put it as an argument to the mail command:

mail -s "Some subject" toaddress@example.com


see man mail for other options

Any text you type after issuing the command you can enter the text for your mail directly in the terminal. To end mail text entry, enter a new line with a single ..

Do note that this just queues the mail for sending as if your mac were a functioning mail server. Local delivery to local accounts is easy to set up, to set up a working mail server that connects to the internet requires some more advanced set up as well as a relationship with someone else that operates a mail relay. This isn't a client that works directly with mail services like gmail / yahoo / hotmail or iCloud (MobileMe).