1834437 Members
2386 Online
110067 Solutions
New Discussion

Re: mailcommand

 
harikrishna
Advisor

mailcommand

hi,
i am using uuencode command for attaching the file to mailx command.but i dont know how to give body for that mail.
here the command is:

uuencode hai.doc hai.doc | mailx -s "hai" medakittu@yahoo.co.in <
7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: mailcommand

I'm attaching a script that does it reliably with sendmail.

With this script its a single command line. Its production and it works.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mic V.
Esteemed Contributor

Re: mailcommand

I don't know that my answer is the *only* answer, but I suggest that you create a single file (containing the body and the uuencoded document), then pipe that into mail.

Mic
What kind of a name is 'Wolverine'?
harikrishna
Advisor

Re: mailcommand

hi steven,
can u send the file again plz in rtf or doc format.i havent recived properly at the first time.sorry for asking again.

THANKING YOU

HARI
Elmar P. Kolkman
Honored Contributor

Re: mailcommand

Hari,

Try saving the link and open it with wordpad. But mind, the script won't run on MS environment: its unix only.
Every problem has at least one solution. Only some solutions are harder to find.
Dave La Mar
Honored Contributor

Re: mailcommand

Hari -
Your lack of consideration for your fellow forumers makes it difficult to justify answering you questions.
But we are all here to assis each other and perhaps others can be assisted by the answers provided.
There are a multitude of threads regarding this topic. (Using the search helps.)
I an attaching a text file with many ways of using mailx that are in place in our shop.

Best of luck.

Regards,

dl

"I'm not dumb. I just have a command of thoroughly useless information."
Ronald Schwartz_1
Frequent Advisor

Re: mailcommand

You can also do it on one line like this:
(echo "Body of message here"; uuencode filename filename) | mailx -s "Subject matter" user@someplace.org

The parenthesis around the commands ends up sending the combinded output to the pipe. And as Dave points out there are a bunch of other ways by using the search.
Geoff Wild
Honored Contributor

Re: mailcommand

This is a good utility:

http://hpux.ee.ualberta.ca/hppd/hpux/Users/mpack-1.5/

mpack/munpack version 1.5 for unix

Mpack and munpack are utilities for encoding and decoding
(respectively) binary files in MIME (Multipurpose Internet Mail
Extensions) format mail messages. For compatibility with older forms
of transferring binary files, the munpack program can also decode
messages in split-uuencoded format. The Macintosh version can also
decode messages in split-BinHex format.

Versions are included for unix, pc, os2, mac, amiga and archimedes
systems. The canonical FTP site for this software is
ftp.andrew.cmu.edu:pub/mpack/


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.