Operating System - HP-UX
1753355 Members
5115 Online
108792 Solutions
New Discussion юеВ

Re: How can i send information from unix as attached file?

 
SOLVED
Go to solution
Manuales
Super Advisor

How can i send information from unix as attached file?

how can i send a file from unix operating systme as a file attached? i mean, as a .txt file ....

please let me know ...
i mean , i have problems, one file than i'm sending with mail command contains "~" and it is beind sent incompleted ... it missed this part:
~MO*1*17~Iaa*1*88888843535435*JOOJKD~
also it is saying: Unknown tilde escape.

i want to send it as attached file, how can i do that.
8 REPLIES 8
Steven Schweda
Honored Contributor
Solution

Re: How can i send information from unix as attached file?

You might try a forum search for things like:

hp-ux mail attachment
or:
hp-ux mail attachment mpack

The key is to use a program like uuencode or
mpack to encode the file data into
e-mail-safe ASCII characters.

Many people seem to use uuencode instead of
mpack, but I like the more modern mpack.
(But I don't do this much.)

This one looked useful to me, for example:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1055549
Senthil Kumar .A_1
Honored Contributor

Re: How can i send information from unix as attached file?

hi,

Try this,

uuencode a.txt a.txt | mail manuales@mailbox.com

SK
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Manuales
Super Advisor

Re: How can i send information from unix as attached file?

Thanks a lot Steven !!!!!!!!!!!!!!!!


THANKS !!!!!
Manuales
Super Advisor

Re: How can i send information from unix as attached file?

STEVEN,
This did not work:

ux2dos /path_to/some_file | uuencode some_file.txt | mailx -m -s "MAIL FROM Someone" someone@somewhere.com <
file_for_email_body

it works but with no attached file :(



Yogeeraj_1
Honored Contributor

Re: How can i send information from unix as attached file?

hi,

can you try this instead:
export emailadd="someone@somewhere.com"
export subject="MAIL FROM Someone"
export convertedFile="/tmp/some_file.txt"
export sourceFile="/path_to/some_file"

/usr/bin/ux2dos $sourceFile > $convertedFile

/usr/bin/uuencode $covertedFile "some_file.txt"|mailx -m -s "$subject" $emailadd1


hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Rasheed Tamton
Honored Contributor

Re: How can i send information from unix as attached file?

uuencode myfile.doc myfile.doc | mailx -m -s "with attachment" mailid@yourmail.com

If you still get problems, just check the below program base64

http://www.fourmilab.ch/webtools/base64/
Steven Schweda
Honored Contributor

Re: How can i send information from unix as attached file?

> it works but with no attached file :(

Did you try looking at what comes out of the
pipeline at various stages?

ux2dos /path_to/some_file

ux2dos /path_to/some_file | uuencode some_file.txt

(What was this supposed to do? "man
uuencode"?)
Senthil Kumar .A_1
Honored Contributor

Re: How can i send information from unix as attached file?

Hi Steven,

uuencode accepts 2 options. If you give only 1 option, it will hang. One option is the file attachment itself the other option , the name to be used for the attachment. in your case, since it is a.txt, hence...

uuencode a.txt a.txt | mail "you_mail_id"

Note, if you attache, you need not do a unix2dos conversion...

SK
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)