Mailing an attachment


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Mailing an attachment
# 1  
Old 03-18-2005
Bug Mailing an attachment

Hi,

I need to compress (zip) a flat file and mail the same as an attachment.
I had tried the following piece of code. But when i open the attachment in mail, the data is incorrect (displays all junk characters).

tar cf abc.tar abc.txt
compress abc.tar
uuencode abc.tar.Z abc1.wri | mailx -s "Audit report" xxxx@rediffmail.com

Note: I have already created a file abc.txt.

Thanks.
# 2  
Old 03-18-2005
Please make sure that you have read our rules. And note:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post where your goal is to get an answer more quickly.

I have closed your duplicate thread.
# 3  
Old 03-18-2005
Since you are using compress, what did you expect? It changes the file into a compressed data block file. Unless you are uncompressing it, the file probably looks the same as it does on the system you mailed it from. Compare the two files (the attachment and the compressed file on the original server).

Note, even tar may change the file where it will not be readable. Also, a tar file may not be viewable on some other servers.
# 4  
Old 03-18-2005
An since it it appears that you are only dealing with one file why are you bothering to tar it?
Code:
zip abc.zip abc.txt
uuencode abc.zip abc.zip | mailx -s "Audit report" xxxx@rediffmail.com

# 5  
Old 03-21-2005
Thanks

Thanks for the help.
That was really useful.

Sorry perderabo for cross posting.
I will not repeat the same.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need syntax for mailing in UNIX by using html file as body and along with attachment

Hi All, I need a syntax for mailing in unix by using html code file output as body and along with attachment (without using mutt command) HTML code file : html1.txt Attachment : attach1.txt I was using the below codes but they are not working. ( cat html1.txt ; uuencode attach1.txt... (4 Replies)
Discussion started by: Rokkesh
4 Replies

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

3. Shell Programming and Scripting

mailing with both data and attachment

Hi all, for sending mail in shell script am using mailx command but am un able to send both the data and attachment can any one please help me am using the following command ux2dos $ChangeList.xls | uuencode ChangeList.xls | cat $stroutfile | mailx -m -s "This is a test" test@test.com I... (1 Reply)
Discussion started by: jhon1257
1 Replies

4. UNIX for Dummies Questions & Answers

Mailing in unix

is there any option to mail the value from top command directly to the user.. i want the value of cpu usage from six different servers to be send in a single mail.. thanks, Arun Manas:b: (3 Replies)
Discussion started by: arunmanas
3 Replies

5. Shell Programming and Scripting

HTML mailing

Hi All, I have a comma separated file as below. file-1 ---------- a,b,c d,e,f g,h,i . . . I want to send the above file in Mail in HTML format with all the values of each column in separate cells i.e. the body of the mail should be in tabular format & each field should be separate... (2 Replies)
Discussion started by: 46019
2 Replies

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

7. UNIX for Dummies Questions & Answers

Mailing attachment stops at 199K

Hi, I have a script which part of it mails an attachment. The command is uuencode $v_file_name.zip "output.zip" | mailx -s "$v_subject" $v_to_email There is a problem that it only sends 199K of an attachment. Is there a reason why it would stop at 199K? I've search the net and nothing... (2 Replies)
Discussion started by: m1l
2 Replies

8. Shell Programming and Scripting

Mailing Problem

I have a Unix server with SunOS 5.8 installed on it. I have set a cron job which will send mail across the two different networks. As of now i can only send mails to the abc.com who owns the server but would also like to send it to xyz.com is there any setting or parameter wherein i need to add... (2 Replies)
Discussion started by: nimish
2 Replies

9. Shell Programming and Scripting

Mailing an attachment

Hi, I need to compress (zip) a flat file and mail the same as an attachment. I had tried the following piece of code. But when i open the attachment in mail, the data is incorrect (displays all junk characters). tar cf abc.tar abc.txt compress abc.tar uuencode abc.tar.Z abc1.wri | mailx -s... (0 Replies)
Discussion started by: gayath3
0 Replies

10. UNIX for Dummies Questions & Answers

Mailing an attachment

Hi, I'm fairly new to using Unix and I was just wondering can someone please tell me the simplest way to mail and attachement using the mail command using Solaris? I have tried using uuencode file name | mail johndoe@ttp.ie but it hasn't worked. I have been mailing the file to myself using... (4 Replies)
Discussion started by: gerwhelan
4 Replies
Login or Register to Ask a Question