mailx is not working

i have a file.i want to get that file to my mail.mail services are running.but still i didn't receive the mail.
i have used this command.
mailx -s file1 muraliinfy04@gmail.com < file2.txt.can anybody help me.it's urgent.I am new to unix.
actually file1 i have directed to a file2.txt

try this

uuencode file2.txt file2.txt |mailx -s "subject" muraliinfy04@gmail.com 

---------- Post updated at 05:59 PM ---------- Previous update was at 05:57 PM ----------

or else if you want the content of the text file in body of the mail, you can give

cat file2.txt |mailx -s "subject" muraliinfy04@gmail.com

Make sure your MTA (sendmail, postfix, whatever) can resolve the MX record for the target domain, and can reach that address. Or, if that's not possible, configure a smart relay host that can do that.

Murali,

The command you have used should have not given any errors. It is correct. Did you check with your system admin team if your Linux/Unix PC mail server is configured to send emails outside your network?

-Nithin.

There is so much left out here. What Unix? You might be running a modern Linux, Solaris, some old SCO system or who knows what and the issues of sending mail are going to vary with those.

What is "file2"? If it's just text, that's fine, but if not it's going to at least need to be uuencoded. In either case, did you want to end it so that it shows up in the body of the email or as an attachment? If you want it attached, you need "mutt" or something like that.

You say "mail services are running". How do you know that? Just because something can do local mail doesn't mean it is configured correctly for internet mail.

You might want to look at CleanCode Email for a nice little command line thing that can bypass any local mail server if that's the source of the problem.

i have used this command also ,it's giving this error.
[]\$uuencode file2.txt file2.txt mailx -s hi muraiinfy04@gmail.com
Usage: uuencode [infile] remotefile

and i have check the services with

$ps -ef |grep mail
root 813 1 0 Jul 20 ? 0:00 /usr/lib/sendmail -bd -q15m
dbaprod 28567 20014 0 18:04:20 pts/3 0:00 grep mail

anyone help would be appreciated...

---------- Post updated at 05:39 PM ---------- Previous update was at 05:21 PM ----------

Hi tony i am using
\$uname -a
SunOS catom-gmcapds37 5.8 Generic_117350-54 sun4u sparc SUNW,Sun-Fire-V240
and that is a text file.
can you check with this

---------- Post updated at 08:55 PM ---------- Previous update was at 05:39 PM ----------

can any one tell me what are the minimum requirements mailx to work.?

Is the mail getting off of the local host? Check your mail queue, which is commonly the /var/spool/clientmqueue directory.

Also, try giving mailx the "-v" option, and post the output.

I am getting this error.
cat file2.txt |mailx -v -s "subject" muraliinfy04@gmail.com
muraliinfy04@gmail.com... Connecting to mailhost via relay...
/home/dbaprod/dead.letter... Saved message in /home/dbaprod/dead.letter

in check in the clientmqueue i don't have the permission.

Are you the administrator of the system? If not, contact the admin to see if mail is setup correctly. If you are, su to root