Forrest logo
back to the mailx tool

mailx:tldr:feeaa

mailx: Send mail to a recipient and CC to another address.
$ mailx -s "${subject}" -c ${cc_addr} ${to_addr}
try on your machine

The command mailx is used to send emails from the command line in Unix-like operating systems. The command you provided is as follows:

mailx -s "${subject}" -c ${cc_addr} ${to_addr}

Let's break it down:

  • mailx: The command itself to invoke the mailx program.
  • -s "${subject}": This option is used to specify the subject of the email. The ${subject} is a placeholder for the actual subject that you can provide as an argument to the command.
  • -c ${cc_addr}: This option is used to specify the email addresses for carbon-copy (cc). The ${cc_addr} is a placeholder for the actual email addresses that you want to include in the cc field. Multiple email addresses can be separated by commas.
  • ${to_addr}: This is the recipient email address or multiple email addresses separated by commas. It can be provided as an argument to the command.

So, when you run this mailx command with appropriate values substituted for the placeholders, it sends an email with the given subject to the recipient(s) specified by ${to_addr} and carbon-copies the recipient(s) specified by ${cc_addr}.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the mailx tool