Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to email a html file and some images to someone from a script. The standard answer seems to be to use mutt. However I don't have that installed at the moment.

  • Is there another way I could do it?
  • Is there any security vulnerbilities with installing mutt?
  • I don't need a full on mail reader, I just wanna send some attachments, is there another solution?
share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

mail, mailx and it's derivatives are the most commonly used MUAs for such jobs.

You'll find them much leaner to install and maintain than mutt.

It's important to note that some of the derivatives don't make sending attachments as easy as others.

share|improve this answer
    
How do I send attachments? –  Rory Aug 4 '09 at 14:47
    
"man mailx" has all the answers. –  innaM Aug 4 '09 at 14:52
    
man uuencode will also help –  goo Aug 4 '09 at 14:53
    
It depends on the specific version you have. You might be interested in this thread though - serverfault.com/questions/17589/… –  Dan Carley Aug 4 '09 at 14:55
add comment

To send attachments using mailx:

(uuencode file1.png file1.png
 uuencode file2.html file2.html
 echo "this is in the message body") | mailx -s "This is the Subject" kyle@kylerocks.com

uuencode is included the the sharutils package.

share|improve this answer
1  
Technically they aren't attachments </pedant> –  Dan Carley Aug 4 '09 at 15:12
    
Why not? (Not trying to be argumentative) even you are being pedantic, I don't know the difference, and I don't like not knowing :-) –  Kyle Brandt Aug 4 '09 at 17:38
2  
The it'd be a pleasure to explain :) If you take a look at the source of an email produced by the above then you'll see that the body contains the raw uuencode's without any boundaries. Most MUAs will interpret these uuencoded content as attached files, but some will not and truly they aren't. Real attachements are sent as part of a MIME multipart message which defines the bounaries and types for each part. –  Dan Carley Aug 5 '09 at 20:35
add comment

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.