1752808 Members
6487 Online
108789 Solutions
New Discussion юеВ

Re: Attachments

 
SOLVED
Go to solution
Alan Karelitz
New Member

Attachments

I am attempting to attach a text file report to a email message as an attachement. Using the following command:

uuencode /etc/hosts hosts.txt|sendmail user@abc.com


Sends the file as an attachment, but the file no longer looks like the source. Looks like it's a unix character tranlation issue.

Any ideas on how I can get this to work?

Thanks

Alan Karelitz
5 REPLIES 5
Berlene Herren
Honored Contributor

Re: Attachments

Perhaps MIME functionality is not set up in sendmail?

Add the following lines to /usr/share/lib/mailx.rc

set charset=X-roman8
set charset=us-ascii

Then stop and restart sendmail

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
John Palmer
Honored Contributor
Solution

Re: Attachments

If you are sending the file to a windows platform then you will need to (at least)convert the NL that UNIX uses to CRLF that windows uses as a record separator. This is because the uuencode technique effectively does a 'binary' copy similar to ftp.

Try converting the file with 'ux2dos' first.
Rita C Workman
Honored Contributor

Re: Attachments

This is something we do alot here..because we send reports (and images) via elm as part of the jobstreams for production. I don't know if you'll care for this approach, but we like it...so:


.Yes- you can send a file as a TRUE file
attachment and actually preserve what the file is...here is
the info:
First make sure you at least have Elm 2.4 on your box,
and my example is for a HPUX 10.20 (you need MIME
capability) so be sure you have patch PHNE_15835 (it
doesn't cause a reboot to load).
The next thing you have to do is create a small file (ex
include.file) that is used to send the file as an attachment.
There are a few things you could read on this for more
details at HP's IT Resource if you want. But simple create
a file with this syntax:
[include text.txt text/plain base64]

where text.txt is your file.

The general format is: [include filename type/subtype
encoding]
type/subtype= text/plain, image/gif, image/jgp etc..
encoding=base64, quoted-printable etc...
Another example might be for a Word doc:
[include file.doc application/msword base64]

Now from the command line to send this file as an
attachment to user_abc:

elms -s 'Test attachment file' user_abc@your_org.com ============================================
What this did was email to user_abc@your_org.com the
file test.txt with a subject line of Test attachment file. If you
sent a Word doc it would come across and be a Word file
attachment.
You can do it with text files; image.jpg or gif files; and
more. ....It's a real paper saver.

Regards,
Alan Karelitz
New Member

Re: Attachments

Berlene,

I tried your suggeston, but it had no effect.
Alan Karelitz
New Member

Re: Attachments

John,

The method that you suggested worked very well, but I can't be sure that the end users is going to be on a Windows Platform.

Thanks