Not able to send multiple attachments using uuencode and mailx


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Not able to send multiple attachments using uuencode and mailx
# 1  
Old 03-01-2010
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.

Code:
( uuencode file1.txt file1.txt.lst && uuencode file2.txt file2.txt.lst )  > attachment.txt
cat body.txt attachment.txt > combinemail.txt
mailx -m "Subject text" mailIDFile.txt < combinemail.txt


Thanks
Prasanna

Last edited by Scott; 03-01-2010 at 02:32 AM.. Reason: Code tags please...
# 2  
Old 03-01-2010
You can use the following command to attach the two files using mail command.

Code:
(uuencode  <filename1> <filename1> ; uuencode <filename2> <filename2>) | mailx -s "SUBJECT" <EMAILID>

# 3  
Old 03-01-2010
I tried it too, but facing the same issue
Code:
(cat body.txt; uuencode  <filename1> <filename1> ; uuencode <filename2> <filename2>) | mailx -s "SUBJECT" <EMAILID>


Last edited by Scott; 03-01-2010 at 02:32 AM.. Reason: Code tags
# 4  
Old 03-01-2010
What your body.txt contains? Will body.txt contains body of the mail?
# 5  
Old 03-01-2010
I tried your code in my system.It is working perfectly.

Code:
(cat body.txt; uuencode  <filename1> <filename1> ; uuencode <filename2> <filename2>) | mailx -s "SUBJECT" <EMAILID>

We can also specify subject to the mail using echo command as follows.

Code:
(echo "Body of the Mail"; uuencode  <filename1> <filename1> ; uuencode <filename2> <filename2>) | mailx -s "SUBJECT" <EMAILID>

# 6  
Old 03-01-2010
Think there might be a bug on my mail server (Lotus notes) not able to decode multiple attachments. Referred the following link.
http://linux.die.net/man/1/uuencode.

Tried the following in the command prompt, but still giving junk characters for the second file
uuencode first first.txt | uuencode second second.txt.| mailx -s "Sub " mailid
(first and second are valid files)

Please let me know if it can be resolved.
Thanks,
Srivatsan
# 7  
Old 03-01-2010
uuencode doesn't work on all mail agents.
e.g: usually it's ok on solaris but not on typical linux
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Uuencode for mail attachments not working

Hi, I'm trying to send mail with attachments using uuencode, but it doesn't work. Command (also tried with mailx): uuencode testfile testfile | mail emailadress The email I get doesn't have an attachment, and has this in the message body: begin 664 testfile %=&5S=`H` ` end ... (4 Replies)
Discussion started by: Subbeh
4 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. Shell Programming and Scripting

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 uuencode $file "$file" | mailx -m -s "File" xxx@xx.com but unable to send multiple attachments . I have tried ... (8 Replies)
Discussion started by: RaviTej
8 Replies

5. Shell Programming and Scripting

Sending Multiple Attachments using MAILX

I have created a shell scripts and wanted to email users multiple attachments using mailx. I noticed that when I do a man on mailx I see and -a option for attachments. When I run a: mailx -s "test attachments" -a include_file -a exclude_file testuser@mydomain.com (Interrupt -- one more to... (1 Reply)
Discussion started by: metallica1973
1 Replies

6. Shell Programming and Scripting

uuencode mailx - send multiple emails

The following is an extract from one of my Shell Scripts which uses uuencode and mailx to send an email with multiple attachements: uuencode $LOG_REPORT $(basename $LOG_REPORT) uuencode $HTML_FILE $(basename $HTML_FILE ) ) | if then mailx -b "$COPY_TO" -s "$SUBJECT" -r "$MAIL_FROM"... (2 Replies)
Discussion started by: suthera
2 Replies

7. UNIX for Dummies Questions & Answers

Email recipient problems with uuencode attachments

Most of my email attachments are fine, but some recipients get the email with the uuencode attachment included as "text" at the end of the body of the message. Has anybody seen this? It seems to happen most with yahoo, msn and other freebie email addresses. Thanks (1 Reply)
Discussion started by: Dave Miller
1 Replies

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

9. Shell Programming and Scripting

Using mailx to send email to multiple users.

Hi, I am using the mailx command to send email to multple users. The command works fine when i am sending mail to a single user but when i insert multiple email ids inside the quote it does not work. All the email ids are coming from a property file.Please have a lookt at the property file and... (4 Replies)
Discussion started by: priyaksingh
4 Replies

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