Help with mailx, uuencode


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with mailx, uuencode
# 1  
Old 07-02-2013
Help with mailx, uuencode

Here's my code -
Code:
FILES="file1 file2 file3"
for File in ${FILES}; do
uuencode "${File}" "$(basename ${File}"
done | mailx email@id.com

This works as expected, meaning emailing the files as attachments but with null body. Now what I want is a way to have the Body list the files in order e.g.
Code:
file1
file2
file3

I tried to put "echo" inside the loop accomplish it but doesn't seem to help -
Code:
FILES="file1 file2 file3"
for File in ${FILES}; do
uuencode "${File}" "$(basename ${File}"
echo "${File}"
done | mailx email@id.com

Any suggestions?
# 2  
Old 07-02-2013
Code:
#!/bin/ksh

for file in file[1-3]
do
        (echo "$file"; uuencode "$file" "$file" )

done | mailx -m -s "Subject" email@domain.com

# 3  
Old 07-17-2013
I am new to UNIX and need help with sending an email with a .csv attachment. I'm running on Linux and my code is as follows:

Code:
 
(cat $msgfile1 | uuencode -m $extract) |mailx -r from_email@example.com -s "Waiver Report" -a $extract to_email@example.com

I get the email with the attachment but get the following garbage in the body of the email:

Code:
 
begin 644 /data/inform/projects/accelya/targetfiles/waiver_rpt.csv
`
end

I've successfully used similar code running on HP-UX (using the -m option) but am now running on Linux where the -m option is not valid for the mailx command. In place of this, I'm using the -m option with the uuencode command but still get the garbage in the email body. Does anyone know how to get rid of this?
# 4  
Old 07-17-2013
Code:
uuencode $msgfile $extract |mailx -r from_email@example.com -s "Waiver Report" $extract to_email@example.com


Try that: a couple of changes
no -a for mailx + no -m for uuencode, no cat, no child process for uuencode
# 5  
Old 07-17-2013
Quote:
Originally Posted by ltf1833
In place of this, I'm using the -m option with the uuencode command but still get the garbage in the email body. Does anyone know how to get rid of this?
What email client are you using? Not all of them understand uuencode any more.
# 6  
Old 07-18-2013
Jim, I tried your suggestion but got the same results...

---------- Post updated at 09:17 AM ---------- Previous update was at 09:15 AM ----------

Corona688, how do I determine the mail client on my server?
# 7  
Old 07-18-2013
Not the server. It wouldn't care. Whatever program you view the email with.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mailx attachment using uuencode issue on Outlook2013

Hello all I am on RHEL 6.4. I have been using my bash script which mails one .csv file after zipping (myfile.csv.zip)to my Lotus Notes ID. I use uuencode with mailx to do this. Here is my command - uuencode myfile.csv.zip myfile.csv.zip | mailx -s "Subject" mailid. This all works very cool. Now... (3 Replies)
Discussion started by: krsnadasa
3 Replies

2. Shell Programming and Scripting

Uuencode & Mailx

hi, i am trying to send a pdf attachment which has a name of 200 characters using uuencode and mailx. But the email is not getting delivered. uuencode <filename.pdf> <filename.pdf> | mailx -s "Test" <email_id> (2 Replies)
Discussion started by: ATWC
2 Replies

3. Shell Programming and Scripting

How to embed a html file in a mail sending from Linux box with uuencode or mailx?

How to embed a html file as subject in a mail sending from Linux box with uuencode or mailx or any other way? we do not want the file as attachment, it should be embedded in the mail subject. (2 Replies)
Discussion started by: johnveslin
2 Replies

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

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

6. Shell Programming and Scripting

mailx, uuencode problem

I've this command to run ... Purpose : Send attachment file with e-mail body... ( E-mail body i read it from text file) uuencode TEST_FILE.csv TEST_FILE.csv | cat /usr/local/bin/EMAIL_BODY.txt - | mailx -s "TEST Report" -c receiver1@mail.com receiver2@mail.com Here is the... (2 Replies)
Discussion started by: prash184u
2 Replies

7. Solaris

uuencode and mailx problem

We are running solaris 9. I can send emails using mailx with no problems. I can send attachments using uuencode no problems. What I can't do is change the name to .txt or .doc or anything else using uuencode. The command I am using is: uuencode /tmp/AsetReports /tmp/AsetReports.doc | mailx -s... (2 Replies)
Discussion started by: zeekstern
2 Replies

8. Shell Programming and Scripting

uuencode/mailx

Hi all, I know how to use the uuencode/mailx commands to mail a single file within a directory, e.g. uuencode file.dat file.dat | mailx joe.smith@mail.com but now, i need to be able to mail every file within the directory with one command, any ideas? thanks :b: (1 Reply)
Discussion started by: ocelot
1 Replies

9. UNIX for Dummies Questions & Answers

mailx error message : mailx: NUL changed to @

If I use the "Mail" link instead of the "mail" link to ../mailx I get this error. Mail so-n-so @whatever.com mailx: NUL changed to @ Unknown command: "postmaster" The email still goes through but i get the error. If I use "mail" it goes thru without the error. Any ideas?? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

10. Shell Programming and Scripting

mailx and uuencode question

I have this code below that works well. I also want to attach a logfile to the email. The first part of this code is the body of the email. echo "The size of $dirname/$f1 size = $f1size, and $dirname/$f2 = $f2size'" | mailx -s "Error with file sizes on $HOST Server" xyz@company.com ... (1 Reply)
Discussion started by: ssmiths001
1 Replies
Login or Register to Ask a Question