Link to home
Start Free TrialLog in
Avatar of davidiwharper
davidiwharperFlag for Australia

asked on

Email a GZIP attachment in a bash script

Hello everyone

I am trying (and failing) to write a shell script which can email a GZIP archive as an attachment from my web host's shared server. I've tried following multiple sets of instructions found online with little success. Sometimes the email comes through in gobbledygook (looks like the GZIP file is inline rather than attached), sometimes the GZIP file is present but can't be opened in 7-Zip, sometimes the scripts I've based off of just fail.

So I'd like to start afresh. The web host has (unfortunately) no mutt available, so that easy solution is off the table.

Has anyone got a working script sample I can adapt?

Thanks!
David
Avatar of Pepe2323
Pepe2323

Hi

Have you tried to use mailx?

mailx -a /path/to/file email@address

regards.
ASKER CERTIFIED SOLUTION
Avatar of davidiwharper
davidiwharper
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of davidiwharper

ASKER

Well you know the old saying, if you want it done right do it yourself. Tried a bunch of sendmail/mail/mailx variants, plus a python script, and finally hit the jackpot with Perl.