how to send mail without human intervention?

Brad De Vries devriesbj
Mon May 17 11:38:01 PDT 2004


Here's another suggestion:
-------------
mail -n -s "test2" netllama at linux-sxs.org << EOM
This is the body of the message

With line breaks and everything.
EOM
-------------
HTH,
Brad.
--- Net Llama! <netllama at linux-sxs.org> wrote:
> I'm writing a bash script where I need to send email
> out depending on 
> certain conditions within the script.
> 
> I'm thought that I could use 'mail' to do the job,
> but it seems to 
> require human intervention to send the message out. 
> I'm trying:
> mail -n -s "another test of mail"
> netllama at linux-sxs.org
> 
> yet it keeps insisting on having me type something
> for the body, and 
> then hit Ctrl-D or a . at the end in order to send
> it.  Looking at the 
> man page for mail there doesn't seem to be any
> option that lets me set 
> the body message from the command itself.  Am i
> missing something 
> obvious, or is there a better tool for the job? 
> thanks!


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com


More information about the Linux-users mailing list