Forrest logo
back to the mailx tool

mailx:tldr:a42f7

mailx: Send mail specifying the sender address.
$ mailx -s "${subject}" -r ${from_addr} ${to_addr}
try on your machine

The command mailx -s "${subject}" -r ${from_addr} ${to_addr} is used to send an email from the command line using the mailx program.

Here is the explanation of each component of the command:

  • mailx: It is a command-line utility for sending and receiving emails in Unix-like operating systems.
  • -s "${subject}": This option is used to specify the subject of the email. The ${subject} is a placeholder that should be replaced with the actual subject.
  • -r ${from_addr}: This option is used to specify the sender's email address. The ${from_addr} is a placeholder that should be replaced with the actual email address.
  • ${to_addr}: This is the recipient's email address. The ${to_addr} is a placeholder that should be replaced with the actual email address.

By running this command, an email will be composed with the provided subject and sender's email address, and it will be sent to the recipient's email address.

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