Operating System - HP-UX
1753765 Members
5626 Online
108799 Solutions
New Discussion юеВ

Sending e-mail with zip file attachment via mailx to Outlook

 
Linda Stowell
New Member

Sending e-mail with zip file attachment via mailx to Outlook

I need to send a mail file with several attachments from HP UX to Outlook. The problem is that we have a 5mb limit on the size of the attachments. Since one file is 7mb, I am trying to use tar to zip and compress the files and then using mailx to send this file to Outlook. I get the e-mail but the zipped file is not-readable with winzip. Below are the commands that I am using. Is it possible to read with winzip a file that was zipped with tar on Unix? Has anyone had any luck with this?

Thanks for the help.

tar cvf - BRKRCM.*.csv | compress > $ZIPFILE
uuencode $ZIPFILE $ZIPFILE | mailx -m -s "EPM Broker Commission CSV File"
15 REPLIES 15
Geoff Wild
Honored Contributor

Re: Sending e-mail with zip file attachment via mailx to Outlook

I don't know if this will help - but try using mpack to send the file instead:

http://hpux.ee.ualberta.ca/hppd/hpux/Users/mpack-1.6/



Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Doug O'Leary
Honored Contributor

Re: Sending e-mail with zip file attachment via mailx to Outlook

Hey;

You also might try gzip instead of compress. I've *generally* gotten better compression from gzip than from compress...

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Ivan Ferreira
Honored Contributor

Re: Sending e-mail with zip file attachment via mailx to Outlook

bzip2 has even better compression ratio.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Sandman!
Honored Contributor

Re: Sending e-mail with zip file attachment via mailx to Outlook

Linda,

You're not specifying an output file for the tar command "-" is for stdin not stdout. Might help breaking up the command line:

# tar cvf BRKRCM.*.csv
# compress
# uuencode | mailx -m -s "EPM Broker Commission CSV File"

cheers!
Jeff_Traigle
Honored Contributor

Re: Sending e-mail with zip file attachment via mailx to Outlook

There's nothing wrong with the command line she's using. Tar sending to stdout piped to stdin of compress with it's stdout redirected to a file. Just the way it's all supposed to behave. If she wanted to, she could even put the whole thing on a singel command line by piping stdout from compress into uuencode like this:

tar cvf - BRKRCM.*.csv | compress | uuencode $ZIPFILE | mailx -m -s "EPM Broker Commission CSV File"

As for WinZip handling compressed (Z) and tar archives, I've never had a problem. It's handled those formats for years and numerous versions.

Getting things to show up on the other end can be tricky, however. I think I've sent to Outlook clients before without the -m option on mailx.
--
Jeff Traigle
Sandman!
Honored Contributor

Re: Sending e-mail with zip file attachment via mailx to Outlook

For Jeff...I'm unable to make your command work so the suggestion to break it up (easier to debug)?
Jeff_Traigle
Honored Contributor

Re: Sending e-mail with zip file attachment via mailx to Outlook

Don't know. Works fine for me.

Linda, I don't have a way to test with Outlook and WinZIP, but, if the attachment is showing up in Outlook all right, you might try 7-Zip as an alternative to WinZIP to see if that handles the file any better. Free software and it seemed to work fine on my little test case I ran.

www.7-zip.org
--
Jeff Traigle
Linda Stowell
New Member

Re: Sending e-mail with zip file attachment via mailx to Outlook

I figured out my problem. The file that I used the tar command on didn't have .tar extension which caused confusion with winzip. As soon as I renamed it to a .tar, winzip worked. However I couldn't get compress to work but I did get gzip to work for me. Below is what I ended up with. I had to rename the gzip file to have a .gzip extension because it wouldn't open in Outlook with the .gz extension (it actually made the contents of the file the body of the e-mail message).

Thanks for everyone's help.

tar cvf BRKRCM.tar BRKRCM.*.csv

gzip BRKRCM.tar

cp BRKRCM.tar.gz BRKRCM.tar.gzip

uuencode BRKRCM.tar.gzip BRKRCM.tar.gzip | mailx -m -s "EPM Broker Commission CSV File"
Sandman!
Honored Contributor

Re: Sending e-mail with zip file attachment via mailx to Outlook

Linda,

I used the same commands w/o renaming the "gz" file to "gzip" and WinZip had no problems opening them.

# tar cvf BRKRCM.tar BRKRCM.*.csv; gzip BRKRCM.tar
# uuencode BRKRCM.tar.gz BRKRCM.tar.gz | mailx -m -s "EPM Broker Commission CSV File"

my 2 cents!