How can I send an email through the UNIX mailx
command?
Then run the mailx command and then enter the body of the email, hit enter, and finally press Ctrl+D to deliver it.
The command line: mailx [options] user user user ... sends a mail message to the given users. If you do not specify any users on the command line, mailx lets you read incoming mail interactively.
an example
$ echo "something" | mailx -s "subject" [email protected]
to send attachment
$ uuencode file file | mailx -s "subject" [email protected]
and to send attachment AND write the message body
$ (echo "something\n" ; uuencode file file) | mailx -s "subject" [email protected]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With