How to send mail with multiple files attached?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to send mail with multiple files attached?
# 1  
Old 11-16-2010
How to send mail with multiple files attached?

Hi,

I would like to send a mail with multiples files attached.

Until now i was doing a "find" and then a "tar" of the text files.
As I need to be able to read them on a mobile device such as Blackberry for instance, i would like to send them in one single mail, but without taring them.

is there a inteligent way to do it? (i have found some script telling to do as many uuencode.... as files, but i have 20 files to send).

Thanks a lot for your help,

Pierrito
# 2  
Old 11-16-2010
Please state what Operating System and Shell you are using and your preferred mail transmission program.
Can we assume that the email attachments are basic format text files?
Please post your script which sends one file successfully in a format which can be read on your Blackberry.
# 3  
Old 11-16-2010
Try the below in sunOS. Angle bracket <<>> texts needs to placed with proper values.

Code:
 
cd <<your path here>>
SUBJECT="TEST Multiple file attachment"
TO_LIST="<<here your all To mail list>>"
CC_LIST="<<here your all CC mail list>>"
(
for AttFile in `ls -1`
do
        uuencode $AttFile $AttFile
done
) | /usr/bin/mailx -s "$SUBJECT" -c "$CC_LIST" "$TO_LIST"

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mail command --> send multiple attachments

Hi, i try to send two (multiple) files by the mail-console-command mail -s TEST -a f1.pdf f2.pdf n.ame@ms123.de but it doesn't work. can someone give me a hint? Thanks in advance, IMPe (2 Replies)
Discussion started by: IMPe
2 Replies

2. Shell Programming and Scripting

Send multiple HTML output in one mail

HI, I have two scripts which is sending the mail in html format. Script 1: 1.IFILE=/home/home01/Report.csv if #Checks if file exists and readable then if awk -F, '{ T += $13 } END { exit(!T) }' ${IFILE} then awk -F, 'BEGIN{ c=split("3,4,8,9,13", col) print "To:... (0 Replies)
Discussion started by: Vivekit82
0 Replies

3. Shell Programming and Scripting

Send a mail to multiple users

I have a file 1.txt which has 3 mail ids as below: Maillist=abc@gmail.com def@gmail.com rcg@gmail.com Now I want to write a script which will read this file and send the mail to all the users present in this file. (6 Replies)
Discussion started by: Vivekit82
6 Replies

4. Red Hat

How to send mail with multiple attachments?

We don't have uuencode installed in our machines..... Please tell me how to send mail with multiple attachments ??? URGENT !!!!! Please tell me using command line (or) scripts.......... please...... Thanks in Advance.... (1 Reply)
Discussion started by: vamshigvk475
1 Replies

5. Shell Programming and Scripting

multiple files to be attached

Hi all, Am in need of attaching multiple files of similar pattern? For example the files like a1.txt b1.txt c1.txt can be reffered as *1.txt Can anyone help me in attaching the files of similar pattern without mentioning their names completely. (3 Replies)
Discussion started by: Sindhuap
3 Replies

6. Shell Programming and Scripting

Script Send Mail by Parameters avec Attached file

Hi i have a script for show the information files. ls -l how do you for to place this result in a file of text and to send it attached for e-mail. The information of the mail must be in paramentros. for example e-mail to I must write the e-mail, the subject and the motive of the mail! ... (1 Reply)
Discussion started by: krlos07
1 Replies

7. AIX

Not able to send out multiple file in mail

Hi All, I have AIX 5.3 server. I am not able to transfer multiple file in mail but I can send one file at a time. the following command I am using to send multiple file mail -s 'PICS EXP RATE Logs' lger@nd.com < /data02/transfer/*_experience_rate_log.txt but this not working. i can send... (2 Replies)
Discussion started by: vishalpatel03
2 Replies

8. UNIX for Dummies Questions & Answers

To send a mail with a file attached

Hi, Can anyone please tell me how to send a mail to a person in unix with a file attached. The file need to be zipped and then i want to send the mail to a person. I know that we can able to send mail from unix using the command mail mailaddress to send a mail to a person with the... (5 Replies)
Discussion started by: samudha
5 Replies

9. UNIX for Dummies Questions & Answers

How to send mail to multiple users ???

Hi All, How to send mails to multiple users using a single mailx command. Urgently require help Thanks in advance Rgds Arunava (3 Replies)
Discussion started by: arunava_maity
3 Replies
Login or Register to Ask a Question