Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

is there a way to attach a PDF to an email sent with the UNIX email command?

share|improve this question

migrated from stackoverflow.com Feb 3 '10 at 10:11

This question came from our site for professional and enthusiast programmers.

2 Answers 2

uuencode test.pdf test.pdf | mailx somewhere.com
share|improve this answer
    
will the uuencoding send the pdf properly? –  Brian Feb 3 '10 at 9:54
    
yes. Why not try out for yourself and see? –  user31894 Feb 3 '10 at 9:59
1  
The problem is with the mail client at the other end, which the OP may not be able to control. Not all mail clients support uuencoded attachments. –  ConcernedOfTunbridgeWells Feb 3 '10 at 10:02
    
Exactly, I couldn't open the uuencoded PDF with my funky college email client. Gmail works great though. Would you say most clients support uuencoding because I don't have mpack on my server? –  Brian Feb 3 '10 at 10:04
    
Not necessarily. mpack is made by a third party where uuencode was a part of the core unix tool set from way, way back. It's really a legacy format from the days of UUCP mail. If you're emailing stuff to third parties you really need to use MIME. –  ConcernedOfTunbridgeWells Feb 4 '10 at 10:20

Look at mpack, which can mime encode a file, attach it to an email and mail it. You can also break the process down into steps and use mail (1) to do the actual mailing.

share|improve this answer
    
So I have to download a program to pull this off? –  Brian Feb 3 '10 at 9:24
    
You do if you want to MIME encode the attachment. There is an older standard called uuencode but it may not be supported by all email clients. mpack comes with most linux distros and may be on the contributed software collections that unix vendors tend to make available. Otherwise you will have to download and install it. Note that it does not necessarily have to be installed in /usr/bin; you could install it somewhere else if installing software in system areas is not possible. –  ConcernedOfTunbridgeWells Feb 3 '10 at 9:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.