Mailx help
mailx
is a command-line email client that allows you to send and receive email messages. Here are some basic commands and options to get you started:
Sending Email
mailx -s "Subject" [email protected]
: Send an email with a subject and a blank body.mailx -s "Subject" [email protected] < message.txt
: Send an email with a subject and a message body from a file.mailx -c
: Compose a new email message.
Receiving Email
mailx
: Check for new email messages and display them.mailx -f
: Check for new email messages and display them, then exit.mailx -u
: Check for new email messages and display them, then delete them.
Managing Email
mailx -d
: Delete a message.mailx -r
: Reply to a message.mailx -f
: Forward a message.mailx -s
: Save a message to a file.
Options
-a
: Attach a file to an email message.-b
: Set the body of an email message.-c
: Compose a new email message.-d
: Delete a message.-f
: Check for new email messages and display them, then exit.-h
: Help.-i
: Ignore errors.-l
: List email messages.-r
: Reply to a message.-s
: Set the subject of an email message.-t
: Set the recipient of an email message.-u
: Check for new email messages and display them, then delete them.
Examples
mailx -s "Hello" [email protected]
: Send an email with the subject "Hello" to [email protected].mailx -s "Hello" [email protected] < message.txt
: Send an email with the subject "Hello" and a message body from a file named message.txt to [email protected].mailx -f
: Check for new email messages and display them, then exit.mailx -d 1
: Delete the first email message.
Note: The exact syntax and options may vary depending on the version of mailx
you are using.