This documentation supports the 11.2 version of BMC Discovery.

To view an earlier version of the product, select the version from the Product version menu.

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

-S smtp-use-starttls

-S ssl-verify
-S smtp-auth=login

-S smtp-auth-user=username

-S smtp-auth-password=password

Example usage

To send a copy of the /etc/motd file:

cat /etc/motd | mailx -s "Today's message" -S from="" \
                            -S smtp="smtp://"

Was this page helpful? Yes No Submitting... Thank you