Messaging
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Linda Stowell
Occasional Visitor

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
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
Occasional Visitor

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!
Dave La Mar
Honored Contributor

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

Linda -
Just another opinion. We often use gzip since it's compression ratio is better than compress.

As with many windows users, we send files to, we were told the zipped file was corrupt.
Subsequent to that we found that WINRAR worked fine for unix zipped files.

Your mailx portion looks fine.

Best of luck.

Regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Florian Heigl (new acc)
Honored Contributor

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

The zipped file is not in pkzip (implemented in windows) format, but in gzip format.

There's two close choices:

-Install a better archive handler on Windows (winrar, winace, winzip, to my knowledge all have to be licensed for at least commercial use)

- Compile pkzip on HP-UX (works, but the manhours involved will equal the license cost; still a useful idea.)
yesterday I stood at the edge. Today I'm one step ahead.
Keerat Singh
Occasional Visitor

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

Linda,

It is very useful info you have posted. I wanted to the same thing but my client OS is Linux. Any ideas?

I appreciate you help or any forum members help.

Regards,

Keerat
Steven Schweda
Honored Contributor

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

> I wanted to the same thing but [...]

This would work better in a new thread, but
that new thread can refer to this old one.

> my client OS is Linux.

So you want to send e-mail with an attachment
from an HP-UX system to a Linux system? The
methods shown here should work, but the best
answer may depend on the e-mail client
program at the destination.


By the way, ...

> - Compile pkzip on HP-UX (works, but the
> manhours involved will equal the license
> cost; still a useful idea.)

Info-ZIP's (free) Zip and UnZip programs work
just fine on HP-UX, if you're looking for a
more Windows-compatible file compress/archive
method.

http://www.info-zip.org/
Keerat Singh
Occasional Visitor

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

Thanks for quick reply; I really appreciate it. I am trying to send zipped file from Linux to MS Outlook.

I have tried everything and no luck :-(

???

Keerat
Steven Schweda
Honored Contributor

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

> I have tried everything and no luck :-(

Obviously not true. For example, you
haven't tried asking about Linux in a Linux
forum.

And when you start a new thread in the right
place, you might say _which_ Linux (and which
version). Then you might give an example of
what you have tried, with an explanation of
what went wrong when you tried it. It's
often difficult to diagnose "no luck" without
more information than "no luck".