Sending an email with a body and attachments using uuencode


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sending an email with a body and attachments using uuencode
# 1  
Old 02-12-2013
Sending an email with a body and attachments using uuencode

Hi,

Im having a bit of an issue with using the uuencode command and sending out an email.

My aim is to send an email out which has a body and also have attachments. Currently I can either get one or the other and not both on the same email.


uuencode /apps/Backup_Verification/DB_Structure_Files_AB/main.txt Main_prorest.txt > /apps/Backup_Verification/tmp/out.mail
uuencode /apps/Backup_Verification/DB_Structure_Files_BB/main.st Main_structure.txt >> /apps/Backup_Verification/tmp/out.mail

cat /apps/Backup_Verification/email-body.txt >> /apps/Backup_Verification/tmp/out.mail

/usr/local/bds/mailsend.s mailx "Backup Verification" <email address> <email address> /apps/Backup_Verification/tmp/out.mail


This just ignores the body and creates an email with the 2 attachments

Any help will be much appreciated as Ive been stuck on this for ages Smilie

Last edited by vbe; 02-12-2013 at 09:57 AM..
# 2  
Old 02-12-2013
What's your OS, uname -a?
uuencode should take two arguments or must read from stdin.
uuencode is not compliant with MIME attachments, so is visible in the body text by most mail readers.
How do you read the mails?
# 3  
Old 02-12-2013
SunOS awards-live 5.10 Generic_137111-07 sun4u sparc SUNW,Sun-Fire-V890

I read the emails in outlook 2010 (HTML) - attachemnts show fine but the body of the email is blank
# 4  
Old 02-12-2013
I am a bit surprised. Perhaps your /usr/local/bds/mailsend.s converts uuencoded sections to MIME.
Try to switch the order, mail-body.txt first, then the uuencode statements.
Remember that the first write to the output file must overwrite with > and following writes must append with >>
This User Gave Thanks to MadeInGermany For This Post:
# 5  
Old 02-12-2013
Thats brill!!! thankyou Smilie
Just switching the order around has worked perfectly Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Sending email with message body and attachment

Hello experts!! I am trying to send an email with message body and attachment.but i am getting any one like message body or attachment. I tried below command: (echo "subject:test";echo "MIME-Version: 1.0";echo "content-transfer-encoding:base 64";echo "content-type:txt;name=test.txt";cat... (2 Replies)
Discussion started by: Devipriya Ch
2 Replies

2. Shell Programming and Scripting

Message Body while sending an email

I am making use of the following code to display the results of my txt file in an email: mail -s 'Count Validation Test Comparison Results' Ronit@XYZ.com < Count_Validation_Results_`date +%m%d%Y`.txt Email Output: ----------Query 1 Count Validation Results-------- Source count is 4 Target... (7 Replies)
Discussion started by: ronitreddy
7 Replies

3. Shell Programming and Scripting

Sending attachment with email without using uuencode and mutt

Hi All, do we have any option for sending attachment with email except using uuencode and mutt, because if i use these utilities then i will have to install them separately which is not feasible at time. please suggest on this. (2 Replies)
Discussion started by: lovelysethii
2 Replies

4. Shell Programming and Scripting

Mailx sending attachments to personal email, but not SharePoint?

Hello! I am writing a KornShell script that (in addition to other things) sends a file from a Unix directory to a SharePoint directory. However when executing the script there is no sign of the file on the SharePoint. I have tested the script using my personal email as the destination and the... (3 Replies)
Discussion started by: mattkoz
3 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

Sending email with attachment and body

Hi I want to able to attach a file to a email and send it with a body the body of the email is within the "body" file, and the attachment in "atch" if i send like below it will send the email correctly /usr/sbin/sendmail me@you.com< body And when i send the attachment alone... (3 Replies)
Discussion started by: sridanu
3 Replies

7. HP-UX

Sending Unix files as attachments in an email

Hi, I am executing the following command in order to send a file as an attachment: mailx -s "Subject" emailID@xyz.com < Testfile.txt Instead of attaching the file Testfile.txt, it is writing the contents of the file in the email message body. Please advise on how I can send the file as an... (7 Replies)
Discussion started by: sangharsh
7 Replies

8. UNIX for Dummies Questions & Answers

Sending email attachments

Hello, I've search the forum, but I cannot find an answer to my specific question. I'm trying to send some files to my professor. Upon his request, I used the following: tar -cvf vh.tar vh_part1.c vh_part2.c vh_part3.c vh_part4.c vh_sample_run15.txt uuencode vh.tar vh.tar > proj1 mail... (2 Replies)
Discussion started by: venush
2 Replies

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

10. Shell Programming and Scripting

Sending attachments using email through shell script

Hi all, I have written a shell script which sends emails with attachments to our clients. All our attachments are simple flat files (.txt format). The script is working fine and sending the attachments to the mail-ids except that, when i am sending the attachments to non-outlook users (Like... (6 Replies)
Discussion started by: symhonian
6 Replies
Login or Register to Ask a Question