unable to send an email attachment

i know its pretty repeated query, but i need to post it in this new thread coz i need it urgently

uuencode /var/tmp/chandra/emaillist.txt emaillist.txt | mail -s "message with encoded attachment" 

am unable to send the attachment emaillist.txt present in the path /var/tmp/chandra/

Is that am doing any mistake anywhere ?

Please enlight me.....

Regards
CS

after subject mail to whom you want to send is missing, try with that.

Cheers,
gehlnar

oops am sorry, i posted a partial code.....

here is my code :

[b]```text
uuencode /var/tmp/chandra/emaillist.txt emaillist.txt | mail -s "message with encoded attachment" xyz@hostname.com

But still am unable to forward that attachment.....

Try with this

uuencode /var/tmp/chandra/emaillist.txt var/tmp/chandra/emaillist.txt | mail -s "message with encoded attachment" xyz@hostname.com

Thanks for your early replies,,,,,

I tried it, same thing, unable to forward that attachment.....

I guess it is to do something with hostname. are you sure that you was able to send mail like this earlier?

Becoz I do not see anything wrong with command.

Cheers,
gehlnar

gehlnar,

This is first time am using that command...... the host name here is gmail.....

I think you need to use "mailx" not "mail". Plus you need to convert the text file to MSDOS format before encoding with uuencode, then invoke mailx with the "-m" switch to turn off MIME headers.

Try this:

uxtodos /var/tmp/chandra/emaillist.txt| uuencode emaillist.txt | mailx -m -s "message with encoded attachment" xyz@hostname.com

This time i tried with my official ID.....still unable to forward the attachment.......

methyl,

Tried your code too.....am just getting an email BUT with No attachment.....

Try this:

Worked fine for me... The only difference is that I used mailx