Unsupported content

 

This version of the product is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

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="discovery@noreply.bmc.com" \
                            -S smtp="smtp://smtpserver.bmc.com" recipient@bmc.com




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

Comments