On Sat, Nov 01, 2003 at 09:35:43PM -0500, Xpression wrote: > Hi guys, I have read the man pages about mail, but I can't found > something to attacht files to sent mails, and I want to mail me some files > from the server to not have to login to read them...somebody can tell me ??? > There is any other solution to get the files, please any help deeply > grateful...
There's a couple or three things you can do. If all you want to do is be able to read the file at the other end (rather than saving it to disk), and it's an acsii text format, then you can just pipe the file into the mail(1) command as the body of an e-mail: % mail -s "Some subject" [EMAIL PROTECTED] < the-file-in-question If the file you want to send is binary, or you want to be able to extract it from the e-mail at the other end, then you can use uuencode(1): % uuencode filename filename | mail -s "Some subject" [EMAIL PROTECTED] Note that you have to put *two* file names on the uuencode command line: the first is the file to read into uuencode and the second is the name that uudecode(1) should use to save the file as at the other end. Most unix mail clients will understand how to extract uuencoded messages, or you can just save the message to a file, which you then run uudecode on. uudecode will ignore all of the message headers and other stuff automatically. That's about the limit of what you can do with the default system: more sophisticated things are possible if you install various bits and pieces out of the ports tree. If you want the file to be sent as a full-blown MIME attachment, there are quite a lot of bits of software for handling MIME encapsulation in there. Probably the easiest thing to do is install one of the mutt ports -- mail/mutt or mail/mutt-devel; either will work. Then: % mutt -a file-name will pop you into an editor where you can fill in the message recipients, subject line, any cover noted required etc. and then send the message with the file as an attachment. If you want to send a message unattended (described as "batch" mode in the mutt documentation http://www.mutt.org/doc/manual/manual-6.html#ss6.1 ) then all you need to do is redirect mutt's standard input from a file -- the contents of the input will form the body of the message: % echo "Here is the file you want" | mutt -a file-name -s "Some subject" [EMAIL PROTECTED] There are all sorts of things you can make mutt do -- see http://www.mutt.org/doc/manual/manual.html -- it really is the least sucky mail client around. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK
Description: PGP signature