RE: mailx / sendmail command
Posted in 2006
On Mon, 2006-07-17 at 07:17, Rob Konikoff wrote: > Yep... we do it all the time... it's a pain in the @!@#$%^!!^^!@#$ > > However, that's the deliver option the customer wants. > > You have several options. It depends on whether you want to include a > message in the body as well. > > (cat message.txt ; uuencode ${TMP}/attachment attach.txt ) | mailx -m -s > "Subject of message" < ${email_addresses} > > Conditionals: You must use proper email addresses for which you have host > resolution (or DNS enabled), the message.txt and the ${TMP}/attachment must > go through the UNIX to DOS conversion, and the whole thing should be tested > at the recipients side. > > I like uuencode. However, I'm a dinosaur. Oh, and I LOVE HP-UX! > > You must have a mail client at the other end with the proper configuration > to translate uuencode. Microsoft Outlook automatic defaults work well here > if you echange, pop or ldap. However, if the destination is a web mail > client, you'll get gobblety gook. The original poster said the file is plain text. In that case it is nearly trivial to build a MIME message ("manually" add MIME headers and MIME boundaries, details left as an exercise for the reader), which should be less likely to cause problems in the mail client. -- Carsten Haese | Phone: (419) 861-3331 Software Engineer | Direct Line: (419) 794-2531 Unique Systems, Inc. | FAX: (419) 893-2840 1687 Woodlands Drive | Cell: (419) 343-7045 Maumee, OH 43537 | Email: carsten@uniqsys.com