• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

if file exists, then send email with attatchment

Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am using:
- HP UX version 11.
- C Shell.

How do I write a script, if *.bad files exist, send an email with those files attached.

By the way, when I do this:

I will get garbage as attachment.

When I do this, the attachment comes out ok but subject parameter is not allowed.

Saloon Keeper
Posts: 26259
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure mail/mailx supports attachments. You may be better off using mutt or something like that.

The Internet email system was designed to be able to route mail through a variety of systems, including IBM mainframes (EBCDIC, not ASCII) and even some that had byte sizes other than 8 bits. Thus, a fundamental constraint was that all email context had to be representable using a basic 7-bit character set that could be freely translated between all these different platforms.

Your attempt to use uuencode is on the right track, but what you really want is MIME encoding. MIME encoding has 2 parts: 1), conversion to character-only format and 2) MIME encapsulation. MIME encapsulation is done by including a special header line in the email text that indicates that an attachment follows and what character sequence will be terminating it. It also tells what kind of data is in the attachment, such as text/html or image/jpeg.

For more on that topic, consult the Internet RFCs. But unless you really want to get into it, an attachment-friendly email app is probably a better choice.
I am Arthur, King of the Britons. And this is a tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic