Operating System - HP-UX
1832869 Members
6562 Online
110048 Solutions
New Discussion

Re: Using a script to e-mail multiple MIME attachments

 
SOLVED
Go to solution
Anthony Baldwin
Occasional Advisor

Using a script to e-mail multiple MIME attachments

Hello everyone. This may sound trival, but I am trying to use a shell script to e-mail all tiff files located in a directory (one tiff per e-mail). However, when trying to use elm, the attachments seem to get converted to some other format, and is no longer a MIME attachment, but distorted text. mailx doesn't seem to do the trick either. Does anyone know how I do this, so that the e-mail receiver will have the proper MIME attachment and not jumbled text. Please advise. Thanks.

Anthony


BTW, here is the simple shell that I was using.
The only way that I've gotten it to work is to use dtmail, however, dtmail brings up a window for every message you want to send, which has too much manual input.

### here's one that doesn't give the
## attachment format

for i in ~/tar_tif_files/*
do
elm -s "tiff $i" fax@feel.mk.telcordia.com < $i

done

## This one works as far as attachments go
## but causes you to manually
## address each individual e-mail.

for i in ~/tar_tif_files/*tif
do
/usr/dt/bin/dtmail -a $i
done
Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding.
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: Using a script to e-mail multiple MIME attachments

I think that this will do the trick.

F1="myfile.txt"
echo "Any text you like" > $F1
echo "more header." >> $F1
for i in ~/tar_tif_files
do
echo "[include ${i} \c" >> $F1
echo "application/octet-stream base 64]" >> $F1
done
echo "Any text you like as a trailer." >> $F1
elm -s "Subject Text" fax@feel.mk.tel < $F1

You must have a MIME enabled version of elm (PHNE-15835 on 10.20).
If it ain't broke, I can fix that.
Kevin Wright
Honored Contributor
Solution

Re: Using a script to e-mail multiple MIME attachments

try this..
uuencode 'file name' 'attachment name' | sendmail -v address
Rita C Workman
Honored Contributor

Re: Using a script to e-mail multiple MIME attachments

Here's a copy of something I wrote because I have to run some daily system performance jobs and email the files....your welcome to check it out...

/rcw
Rita C Workman
Honored Contributor

Re: Using a script to e-mail multiple MIME attachments

I had to go back and get some more info...on my script I'm sending them as application/msword, but you mentioned you need to send tiff files. MIME will support this according to:
http://us-support.external.hp.com/cki/bin/doc.pl/sid=a10342b301d231f7ca/screen=ckiDisplayDocument?docId=200000030894932
There is also this thread:
http://us-support.external.hp.com/cki/bin/doc.pl/sid=d79542db1c1eeb1c8c/screen=ckiDisplayDocument?docId=200000048789276

/rcw