attachment in file


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users attachment in file
# 1  
Old 12-28-2011
attachment in file

Hi ,

I am planning to send one file as attachment thourgh script in unix
code is :

( cat body- /userdata/NEV/Scr/ee.txt; uuencode ee.txt) \
| mail -s "Email With Body Text and Attachment" ramesh.ss@gmail.com

it is not working .Please help me on this regards.

Thanks,
Raj
# 2  
Old 12-28-2011
cat body-

what is body- ?
# 3  
Old 12-28-2011
Quote:
Originally Posted by itkamaraj
cat body-

what is body- ?
Hi

I removed BODY and i wrote like this ,still it is not working

`cat /userdata/NEW/Scr/ee.txt; uuencode ee.txt \ | mail -s "Email With Body Text andAttachment" "raju111.net@gmail.com"`
# 4  
Old 12-28-2011
Try with this ..
Code:
uuencode /userdata/NEW/Scr/ee.txt ee.txt | mail -s "Email With Body Text andAttachment" raju111.net@gmail.com

# 5  
Old 12-28-2011
Please say what Operating System and version you are using. I assume that becuse you are using "mail -s" not "mailx -s" that this is not unix?

You will probably need to convert the attachment from unix to MSDOS format before running the uuencode. Do you have the "ux2dos" or "unix2dos" utility program?
Also, please show where the email body is coming from, and the full path name to the attachment).

The important think in the design of the script is to ensure that all the output ends up on the pipeline where the mail command can read it.

Code:
(cat email_body.txt ; ux2dos /userdata/NEV/Scr/ee.txt | uuencode ee_att.txt ) | \
     "Email With Body Text and Attachment" "raju111.net@gmail.com"

Also, lose the backticks on the command line. They are not required or desirable.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Email with .dat file as attachment

Hi, I am trying to email a .dat file as an attachment from unix MS-outlook. I tried uuencode but it is not attaching the file, rather it is placing some junk data in the body of mail. Below is my code (cat Message.txt; uuencode Attach_File.DAT Attch_File.DAT) | mailx -s "SUBJECT"... (12 Replies)
Discussion started by: sampoorna
12 Replies

2. Shell Programming and Scripting

Replace A File From Email Attachment

I am looking for a method that would allow me to replace an existing file with one from an email attachment. Any way of scripting this, so when an email comes in from a particular email id, it takes the attached file, and replaces an existing file. (6 Replies)
Discussion started by: evencustard
6 Replies

3. Solaris

Sent an email attachment, but the attachment is empty

I'm trying to send a .zip file from my unix box to my work email (email client outlook) The file name that I'm trying to sent is sites.zip and this is how I do it: uuencode sites.zip | mailx -s "testing" myname@mydomain.com When I open the .zip, the zip is empty. Looking around the we, I... (17 Replies)
Discussion started by: amb1s1
17 Replies

4. UNIX for Advanced & Expert Users

email file as attachment...

Hello all, i am on hp-ux 11.23...i am trying to send an email as an attachement but it dose not seem to work...after reading on google i found that we can use uuencode to send file at attachement...here is my file and the syntax $ cat test.txt NAME --------- TEST $ uuencode... (7 Replies)
Discussion started by: abdul.irfan2
7 Replies

5. Shell Programming and Scripting

Adding an attachment as an attachment to mailx

I don't want the attachment embedded in the mail. I would like a file attached. When I do mailx -s "Report, `date +'%D %r` " -r "Notifications" bob@bob.com < /usr/local/bin/myreport.log> /dev/null It gets embedded in my email. I want a file attachment. How do I do that? (2 Replies)
Discussion started by: guessingo
2 Replies

6. Shell Programming and Scripting

UNIX file attachment in email

Hi, I have a syntax for mail attachment as $EMAIL "Wrapper $wrapper_script_name has failed" " $wrapper_script_name has Failed " $failed_email_address and $EMAIL is as below MSGSub=${1} MSGText=${2} RMAIL=${3} #set LANG='' export LANG='' echo "${MSGSub}" | mailx -s "${MSGText}" ... (1 Reply)
Discussion started by: satgur
1 Replies

7. UNIX for Advanced & Expert Users

how to send file as attachment with mail ?

hello , i m new to linux/unix , well in my college their is linux server to which we all (i and my frnds) login , we can send mail to each other through command "mail" . but any one can tell me how can i attached a binary file with mail. we are using red hat , "pine ", "mailx" , all... (2 Replies)
Discussion started by: alert_every1
2 Replies

8. Shell Programming and Scripting

Mail with File attachment

I have a requirement that I would have to write a shell script for sending a mail. The logic is that script should send a mail with a file attachment. I know that I could use 'uuencode' for the attachment but It just displaying the file content in the mail but I just need to attach the file in... (3 Replies)
Discussion started by: thambi
3 Replies

9. UNIX for Dummies Questions & Answers

Multiple File Attachment Using Mailx

HI, I want to send mail using mailx and also want to attach all files under specific directory.(*.*). Please show me a script. Thanks (3 Replies)
Discussion started by: pnathani
3 Replies

10. UNIX for Dummies Questions & Answers

How do I send a file as an attachment (gzip file) on a Unix system

Hi, How do I send a file as an attachment (gzip file) on a Unix system ? Using sendmail. Please help me. :confused: (3 Replies)
Discussion started by: lacca
3 Replies
Login or Register to Ask a Question