Options (4)
-s, --subjectbooleanSend mail (the content should be typed after the command, and ended with `<Ctrl d>`)
Example:
mailx {{[-s|--subject]}} "{{subject}}" {{to_addr}}-c, --ccbooleanSend mail to a recipient and CC to another address
Example:
mailx {{[-s|--subject]}} "{{subject}}" {{[-c|--cc]}} {{cc_addr}} {{to_addr}}-r, --from-addressbooleanSend mail specifying the sender address
Example:
mailx {{[-s|--subject]}} "{{subject}}" {{[-r|--from-address]}} {{from_addr}} {{to_addr}}-a, --attachbooleanSend mail with an attachment
Example:
mailx {{[-a|--attach]}} {{path/to/file}} {{[-s|--subject]}} "{{subject}}" {{to_addr}}Examples (6)
Send mail (the content should be typed after the command, and ended with `<Ctrl d>`)
mailx [-s|--subject] "subject" to_addrSend mail with content passed from another command
Send mail with content read from a file
mailx < content.txt [-s|--subject] "subject" to_addrSend mail to a recipient and CC to another address
mailx [-s|--subject] "subject" [-c|--cc] cc_addr to_addrSend mail specifying the sender address
mailx [-s|--subject] "subject" [-r|--from-address] from_addr to_addrSend mail with an attachment
mailx [-a|--attach] path/to/file [-s|--subject] "subject" to_addrmade by @shridhargupta | data from tldr-pages