Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I send an email through the UNIX mailx command?

Tags:

unix

email

mailx

How can I send an email through the UNIX mailx command?

like image 407
user269484 Avatar asked Feb 17 '10 16:02

user269484


People also ask

How do I send mail to an external user using mailx in Linux?

Then run the mailx command and then enter the body of the email, hit enter, and finally press Ctrl+D to deliver it.

How do I use mailx command?

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.


1 Answers

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] 
like image 110
ghostdog74 Avatar answered Sep 20 '22 23:09

ghostdog74