How to send email from the command line?

der.hans PLUGd at LuftHans.com
Fri Jan 12 23:44:47 MST 2007


Am 12. Jan, 2007 schwätzte Josef Lowder so:

> On Fri, 12 Jan 2007 18:30:31 -0700, Dan Lund wrote
>> On 1/12/07, Josef Lowder <joe at actionline.com> wrote:
>>> I'm still trying to figure out how to send plain text
>>> email messages from the command line.
>>> What would be the simplest way to do this?
>
>> With the mail command.  Such as:
>>
>> Echo "hello" | mail -s subjectline destination at mail.com

Yup, mail or mailx is the way to go.

> However, I found my previous notes on this subject and
> now recall that some suggested that 'postfix' would be
> better (and safer) to use than 'sendmail'
>
> Is that correct?  And if so, how do I acquire and install it?

Depends on your distribution. Hopefully you've got apt-get, aptitude or
yum setup.

The install should ask you a couple of questions and set it up for you.

The regular install should be able to handle a simple setup, which is
likely all you need.

ciao,

der.hans
-- 
#  https://www.LuftHans.com/        http://www.CiscoLearning.org/
#  Join the League of Professional System Administrators  https://LOPSA.org/
#  "Luckily, this is a comic book, for which no idea is too complex."
#    -- Larry Gonick from The Cartoon History of the United States


More information about the PLUG-discuss mailing list