Operating System - HP-UX
1833788 Members
2173 Online
110063 Solutions
New Discussion

Attaching several files in the same email to be sent using ux2dos command.

 
Manuales
Super Advisor

Attaching several files in the same email to be sent using ux2dos command.

Hi ...
I know that i can attach files as ".txt" as follows:

ux2dos $log_mail | uuencode DAILY_MONITOR_$hour.txt | mailx -m -s "WARNING - DAILY MONITORING - $hou
r " $emails_dma $3 $4


if i have 5 files for being attached to the same email to be sent, how can i do that????

please let me know.
thanks.
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: Attaching several files in the same email to be sent using ux2dos command.

Shalom,

A good base script:

http://www.hpux.ws/mailfile2

It does attachments very well. Modifying it to do multiple attachments should be trivial.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sandman!
Honored Contributor

Re: Attaching several files in the same email to be sent using ux2dos command.

Try the following cmd:

(echo; uuencode f1 f1; echo; uuencode f2 f2; echo; uuencode f3 f3; echo; uuencode f4 f4; echo;uuencode f5 f5) | mailx -m -s "5 files attchd" abc@xyz.com

...where f1 f2 f3 f4 and f5 are placeholders for the filenames. Just replace them with the actual filenames and you should be all set.

~cheers
VK2COT
Honored Contributor

Re: Attaching several files in the same email to be sent using ux2dos command.

Hello,

Previous posters already gave you some good references.

There ae yriad of Perl scripts (albeit,
they require additional modules like
MIME::Lite, MIME::Base64 and Mail::Sendmail...

Another powerful way is to use Mail User AGent like mutt.

mutt -a file1 -a file2 -a file 3 -s "Multiple attachments" -x recipient@domain.dom
Voila.

The beauty of Unix and Linux is the
choices one has.

I want to choose what suits me,
not what someone else dictates or
might think I need :)

So, you have many free options for
email attachments...

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Rita C Workman
Honored Contributor

Re: Attaching several files in the same email to be sent using ux2dos command.

I still use the 'include' file for this kind of thing. Works great for scripts too. And you can send .txt, and with some tweeking on the type of file you can even send .tiff,.jpg,MSWord & MSExcel....etc.

Just create any dummy file name and add lines:
[include text/plain base64]

In case it doesn't print right, the line is held between a left and right plain bracket.

Once I create the file with all the include lines (one for each file) I just email them using elm:

elm -s "Bunch of files" you@company.com < dummy.file

Quick,easy,free....and easy to script for changing log files you want sent daily.

Rgrds,
Rita
VK2COT
Honored Contributor

Re: Attaching several files in the same email to be sent using ux2dos command.

Hello Rita,

The nice thing about mutt is that you do not
need to care about type of files in
attachments. There is no configuration
change.

This works straight away:

mutt -a doc1.txt -a doc2.doc -a doc3.xls -a
doc4.pdf ...

Any type of file is handled. On the receiving
side, it is up to the Mail User Agent to
extract the attachments and use proper tools to
open them (for example Word for .doc,
Adobe Reader for .pdf, and so on).

Otherwise, I used elm for many years too :)

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Rita C Workman
Honored Contributor

Re: Attaching several files in the same email to be sent using ux2dos command.

Hello Dusan,

Gotta luv options. I'll have to give it a try when I get a chance.

I especially love the site's slogan.

Rgrds,
Rita