How to send email with multiple attachments ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to send email with multiple attachments ?
# 8  
Old 08-22-2012
this is what i got with uname -a ....
Code:
HP-UX serverName B.11.31 U ia64 3073994272 unlimited-user license

.. Can you please tell how I can get text body in same email along with attachments ?

I have tried
Code:
(uuencode $HOME_DIR/first.sh first.sh ; uuencode $HOME_DIR/cd_test.sh cd_test.sh ; echo  $HOME_DIR) | mailx -m -s "testing email" ravi@xx.com

... it is not working ..

If i had the text body in a file , cat command might have worked , but i do not have as such . also tried

Code:
(uuencode $HOME_DIR/first.sh first.sh ; uuencode $HOME_DIR/cd_test.sh cd_test.sh) | mailx -m -s "testing email" ravi@xx.com <<EOF
$HOME_DIR
EOF


Last edited by methyl; 08-22-2012 at 10:14 PM.. Reason: please use code tags; reformatted post for readability
# 9  
Old 08-22-2012
Quote:
.. Can you please tell how I can get text body in same email along with attachments ?

I have tried

(uuencode $HOME_DIR/first.sh first.sh ; uuencode $HOME_DIR/cd_test.sh cd_test.sh ; echo $HOME_DIR) | mailx -m -s "testing email" ravi@xx.com
Have you tried this variation (some licence taken on the output format):
The only real difference is that the email body should appear before the attachments.
Code:
(echo "Testing email body content ${HOME_DIR}" ; uuencode ${HOME_DIR}/first.sh first.sh ; uuencode ${HOME_DIR}/cd_test.sh cd_test.sh) | mailx -m s "testing email" ravi@xx.com

Ps. It always helps to know what the final output should look like.

Last edited by methyl; 08-22-2012 at 10:33 PM.. Reason: typos;layout
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. HP-UX

Email Using uuenview w/ Multiple Attachments

HP-UX mbhp7640 B.11.31 U ia64 4294967295 unlimited-user license Our database builds a MIME compliant html email, then cats that to sendmail - no problem. Due to horrible issues with the native uuencode, we long ago began using uuenview to encode our attachments - no problem. An example is... (1 Reply)
Discussion started by: bubba77
1 Replies

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

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

4. UNIX for Dummies Questions & Answers

Send Files as Attachments through email

Dear Members, I am trying to send a file as an attachment from the command prompt in Linux. I am using the following: (echo "Find attached Exception Report"; uuencode $DATA_TOP/out/data/$err_rpt_file $err_rpt_file)|/bin/mailx -s "***Exceptions Found" davidk@xyz.com Here err_rpt_file... (2 Replies)
Discussion started by: sandeep_1105
2 Replies

5. UNIX for Advanced & Expert Users

Email with multiple attachments & HTML body

I have a html file: # cat sample.html <html> <body> Sample HTML file</p> </body> </html> And I have two excel sheets (sheet1.xls & sheet2.xls) I want to send an email by having the sample.html as the message body and two spreadsheets as the attachments. I tried using the below command:... (12 Replies)
Discussion started by: BHM
12 Replies

6. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

7. Shell Programming and Scripting

Not able to send multiple attachments using uuencode and mailx

Hi, I am seeing some junk characters when I attach the second file, given below is the logic I used. Please help me resolving the issue. ( uuencode file1.txt file1.txt.lst && uuencode file2.txt file2.txt.lst ) > attachment.txt cat body.txt attachment.txt > combinemail.txt mailx -m... (7 Replies)
Discussion started by: prasperl
7 Replies

8. UNIX for Dummies Questions & Answers

to send email to multiple users

hi, i'm pretty new to this unix. i've been asked to create a shell script which will pick up the email id from a text file(stored in same machine, same directory) searches for that id in another file in which a product name( a one line text) is mentioned against it. then it should send a mail... (0 Replies)
Discussion started by: vishwas.shenoy
0 Replies

9. UNIX for Dummies Questions & Answers

Help ! How to get elm to send multiple attachments - in batch mode

From a program, I want to execute a UNIX elm command that will send multiple txt attachment files to an email address. I can do it for one attachment only ie. "elm -s"subject" emailaddress < attachment.txt" 1. The attachment is received in the body of the email and not as an attachment. 2. The... (1 Reply)
Discussion started by: anarvan
1 Replies
Login or Register to Ask a Question