Koozali.org: home of the SME Server
Legacy Forums => General Discussion (Legacy) => Topic started by: osiris9510 on December 16, 2005, 08:04:28 PM
-
Is there a way to send e-mail using the command line/bash script?? Id like to e-mail server logs to myself when Im away from the server.
-
Is there a way to send e-mail using the command line/bash script?? Id like to e-mail server logs to myself when Im away from the server.
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
[- sendmail-options ...]
mail [-iInNv] -f [name]
mail [-iInNv] [-u user]
You can also type "info mail" or "man mail" for more info.
I hope the above info helps!
Chris Curtis
-
can you give me an example to send a short message?
-
I've used:
mail -s"Server $HOSTNAME booting" monitor@blah.com admin < /tmp/msg.tmp
to send an email to "monitor" and "admin" where the email body is the contents of the file msg.tmp.
Interactively you can do a:
mail -sSUBJECT who@there.org <ENTER>
then type any message content then when done type a single .<ENTER> on an empty line (I thin kit asks for a CC address) then off goes the email.
Check out "mutt" rather than "mail" if you wish to send an attachment.