Sending email from the Linux command line
To configure BMC Discovery to send email see Configuring mail settings.
Independently of BMC Discovery you can also configure an appliance to send email automatically. For example, you might want the output of a script emailed to a recipient. To do this, you must use the Linux command line.
To send an email from the Linux command line
To send an email from the Linux command line, pipe the email body into the standard
mailx command. For example to email the contents of a file:
cat filename | mailx -s "subject" -S from="from-address" -S smtp="smtp-server" to-address
|Other useful options|
To send a copy of the
cat /etc/motd | mailx -s "Today's message" -S from="firstname.lastname@example.org" \ -S smtp="smtp://smtpserver.bmc.com" email@example.com