Problem with multiple mail attachments


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem with multiple mail attachments
# 1  
Old 05-30-2011
Problem with multiple mail attachments

Hi everyone...

I am facing problem with the multiple mail attachments.

Code:
cd /work/mohan/pi_log/
mail_file='uuencode ahmedabad.csv ahmedabad.csv ; uuencode ahmedabad_devrpt_20110530.csv ahmedabad_devrpt_20110530.csv'
( $mail_file ) | mailx -m -s"test"  domain@website.com

its giving me error like
Quote:
Usage: uuencode [ -m ] [ source ] remotedest
but same code work well for sending single file as attachment.

Where i am going wrong???
# 2  
Old 05-30-2011
because of your command is like working after shell's comma interpretation as like this..
Code:
uuencode ahmedabad.csv ahmedabad.csv ';' uuencode ahmedabad_devrpt_20110530.csv ahmedabad_devrpt_20110530.csv

so you must use `eval` [from eval man pages .. concatenated together into a single command] for correct interpret
Code:
mail_file='uuencode ahmedabad.csv ahmedabad.csv ; uuencode ahmedabad_devrpt_20110530.csv ahmedabad_devrpt_20110530.csv'
( eval $mail_file ) | mailx -s"test"  domain@website.com

equals to (no error)
Code:
uuencode ahmedabad.csv ahmedabad.csv
uuencode fopen-ing ahmedabad_devrpt_20110530.csv

regards
ygemici
Login or Register to Ask a Question

Previous Thread | Next Thread

10 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. 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

3. Shell Programming and Scripting

Adding Attachments to mail

Hi, I need to send a mail with html code in body and an attachment along with the body and subject. The html code must display a table with data in it in the mail. I have tried the 'sendmail' command, but I am am able to display the table in the mail and unable to attach an attachment. ... (5 Replies)
Discussion started by: Durga Prasad NK
5 Replies

4. Shell Programming and Scripting

problem with attaching multiple attachments dynamically.

Guys, I've been trying to attach & email all txt files from my directory using the shell script below: #!/usr/bin/sh ################################################################################ send_ml_rej_notn() { FILE_NAME=${1} ATTACH_FILE_NAME=`basename ${FILE_NAME}` if ; then ... (0 Replies)
Discussion started by: bhagat.singh-j
0 Replies

5. Shell Programming and Scripting

e-mail with multiple binary attachments!

Hi, I have to send email from UNIX with multiple excel attachments and the sender name needs to be customized (sender name need not to be UNIX user). I have checked many ways from this forum and other sources. But, nothing did work for me. Please help me! thanks, Raja. (1 Reply)
Discussion started by: smr_rashmy
1 Replies

6. UNIX for Advanced & Expert Users

Mail attachments getting corrupted...

Hi , Whenever I try to send mails with attachments to external email Id's the attachment is not encoded properly which appears along with body (text) of the mail. The attachement is always getting corrupted. Can anyone please suggest a solution. Regards, Sandipan (1 Reply)
Discussion started by: Sandipan
1 Replies

7. Solaris

mail with attachments

I want to send a mail with three attachments, but nothing happened. I tried it with mail and mailx. Are there special options for these commands or is it not possible to send mails under Solaris with attachments? Must there be special adjustments in the environment? Can anyone give an... (6 Replies)
Discussion started by: ninjadan
6 Replies

8. AIX

Send mail attachments and have a mail body

Hi, How can I send mail attachments from shell script (AIX) and have a mail body as well ? Thanks in advance. (1 Reply)
Discussion started by: shibajighosh
1 Replies

9. UNIX for Advanced & Expert Users

Problem with multiple excel attachments using mailx

I have written the following code send multiple attachments using mailx (uuencode file1 file1; uuencode file2 file2; uuencode file3 file3;) | mailx -s MultipleAttachments -r Sysadmin abc@xyz.com The attachments are coming properly if the file1,2,3 are either pdf, text, doc. But if these files... (2 Replies)
Discussion started by: ramanam2004
2 Replies

10. UNIX for Dummies Questions & Answers

mail attachments

I'm writing scripts on HP-UX. Is there a way to attach a file to a mail message. I don't want to imbed the data in the mail message. (1 Reply)
Discussion started by: Multithreaded
1 Replies
Login or Register to Ask a Question