Sponsored Content
Top Forums Shell Programming and Scripting How to send email with multiple attachments ? Post 302690265 by RaviTej on Wednesday 22nd of August 2012 05:26:53 PM
Old 08-22-2012
How to send email with multiple attachments ?

Hello ,

I am trying to send an email with two attachments . I have tried all previous suggestion in this forum but none worked. I could send one attachment in an email by

Code:
uuencode $file "$file" | mailx -m -s "File"  xxx@xx.com

but unable to send multiple attachments .
I have tried

Code:
1 .  `(uuencode $file1 $file1 ; uuencode $file2 $file2)` | mailx -m -s "All Files"  xxx@xxx.com 

2.

files= ( "$file1" "$file2" )  
for fileName in ${files[@]} 
	do
	uuencode $fileName $fileName 
	done)` | mailx -m -s "files in attachment" xxx@xx.com

By using 1 , I am getting message that begin : not found .

By 2 , I am getting message that the file could not be found , but I see that the file exists in the path.
I am very confused after trying a lot. Please help

Last edited by methyl; 08-22-2012 at 06:57 PM.. Reason: please use code tags for code and data
 

9 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

9. 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
READPST(1)						  libpst Utilities - Version 0.6						READPST(1)

NAME
readpst - convert PST (MS Outlook Personal Folders) files to mbox and other formats SYNOPSIS
readpst [-D] [-M] [-S] [-V] [-b] [-c format] [-d debug-file] [-e] [-h] [-j jobs] [-k] [-o output-directory] [-q] [-r] [-t output-type-codes] [-u] [-w] pstfile DESCRIPTION
readpst is a program that can read an Outlook PST (Personal Folders) file and convert it into an mbox file, a format suitable for KMail, a recursive mbox structure, or separate emails. OPTIONS
-D Include deleted items in the output. -M Output messages in MH (rfc822) format as separate files. This will create folders as named in the PST file, and will put each email together with any attachments into its own file. These files will be numbered from 1 to n with no leading zeros. This format has no from quoting. -S Output messages into separate files. This will create folders as named in the PST file, and will put each email in its own file. These files will be numbered from 1 to n with no leading zeros. Attachments will also be saved in the same folder as the email message. The attachments for message $m are saved as $m-$name where $name is (the original name of the attachment, or 'attach$n' if the attachment had no name), where $n is another sequential index with no leading zeros. This format has no from quoting. -V Show program version and exit. -b Do not save the attachments for the RTF format of the email body. -c format Set the Contact output mode. Use -cv for vcard format or -cl for an email list. -d debug-file Specify name of debug log file. The log file is now an ascii file, instead of the binary file used in previous versions. -e Same as the M option, but each output file will include an extension from (.eml, .ics, .vcf). This format has no from quoting. -h Show summary of options and exit. -j jobs Specifies the maximum number of parallel jobs. Specify 0 to suppress running parallel jobs. Folders may be processed in parallel. Output formats that place each mail message in a separate file (-M, -S, -e) may process the contents of individual folders in parallel. -k Changes the output format to KMail. This format uses mboxrd from quoting. -o output-directory Specifies the output directory. The directory must already exist, and is entered after the PST file is opened, but before any processing of files commences. -q Changes to silent mode. No feedback is printed to the screen, except for error messages. -r Changes the output format to Recursive. This will create folders as named in the PST file, and will put all emails in a file called "mbox" inside each folder. These files are then compatible with all mbox-compatible email clients. This format uses mboxrd from quoting. -t output-type-codes Specifies the item types that are processed. The argument is a sequence of single letters from (e,a,j,c) for (email, appointment, journal, contact) types. The default is to process all item types. -u Sets Thunderbird mode, a submode of recursive mode. This causes two extra .type and .size meta files to be created. This format uses mboxrd from quoting. -w Overwrite any previous output files. Beware: When used with the -S switch, this will remove all files from the target folder before writing. This is to keep the count of emails and attachments correct. FROM QUOTING
Output formats that place each mail message in a separate file (-M, -S, -e) don't do any from quoting. Output formats that place multiple email messages in a single file (-k, -r, -u) now use mboxrd from quoting rules. If none of those switches are specified, the default output format uses mboxrd from quoting rules, since it produces multiple email messages in a single file. Earlier versions used mboxo from quoting rules for all output formats. AUTHOR
This manual page was originally written by Dave Smith <dave.s@earthcorp.com>, and updated by Joe Nahmias <joe@nahmias.net> for the Debian GNU/Linux system (but may be used by others). It was subsequently updated by Brad Hards <bradh@frogmouth.net>, and converted to xml format by Carl Byington <carl@five-ten-sg.com>. COPYRIGHT
Copyright (C) 2002 by David Smith <dave.s@earthcorp.com>. XML version Copyright (C) 2008 by 510 Software Group <carl@five-ten-sg.com>. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, please write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. VERSION
0.6.54 readpst 0.6.54 2011-05-27 READPST(1)
All times are GMT -4. The time now is 03:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy