tags:

views:

417

answers:

2

How can i send an email through UNIX mailx command

A: 

From the man page:

Sending mail

To send a message to one or more people, mailx can be invoked with arguments which are the names of people to whom the mail will be sent. The user is then expected to type in his message, followed by an ‘control-D’ at the beginning of a line.

In other words, mailx reads the content to send from standard input and can be redirected to like normal. E.g.:

ls -l $HOME | mailx -s "The content of my home directory" [email protected]
hlovdal
+2  A: 

an example

$ echo "something" | mailx -s "subject" [email protected]

to send attachment

$ uuencode file file | mailx -s "subject" [email protected]
ghostdog74
I tried it but it is givinng no response. Neither it is giving some error msg nor sending the mail to [email protected]. Do there is need for any server configuration?
there is no need for any configuration. Check your internet connection. I have a direct connection to the internet through cable, I don't use proxies or anything so it works on my side.
ghostdog74