Friday, April 06, 2007

sent file as an attachment from unix

for my reference & knowledge sharing on how to sent text file as an attachment from unix.
most of the ways i found on net, they suggest to do like this:
$ uuencode filename.txt attachment_name.txt | mailx -s "file attach"
it works fine but you'll not get the same format as your original file. in other word the text file format totally screw up!

so you should using this instead:
$ unix2dos -437 filename.txt | uuencode attachment_name.txt | mailx -s "file attach"
go figure out yourself what -437 is for :P

No comments: