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 ssl-verify |
-S smtp-auth=login |
|
-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
Comments
Log in or register to comment.