1

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?
Amandasaurus
  • 31,471
  • 65
  • 192
  • 253

2 Answers2

2

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.

Dan Carley
  • 25,617
  • 5
  • 53
  • 70
2

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.

Kyle Brandt
  • 83,619
  • 74
  • 305
  • 448
  • 2
    Technically they aren't attachments – Dan Carley Aug 04 '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 04 '09 at 17:38
  • 3
    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 05 '09 at 20:35