1748105 Members
4891 Online
108758 Solutions
New Discussion юеВ

mail command

 
SOLVED
Go to solution
viseshu
Frequent Advisor

mail command

Hi All,
I need to attach a document in a mail and send it from HP-UX box to my personal mail id. when i gave the following command,trying to attach abc.txt,
uuencode abc.txt abc.txt |mail id@domain.com,
i could receive the mail but there is no new line in the received file..all the lines gets displayed in a single line with a box as delimeter. Can this be over come?
16 REPLIES 16
Anshumali
Esteemed Contributor
Solution

Re: mail command

You forgot
ux2dos abc.txt
Prepend this before your command and pipe the output to your command mentioned above.

ux2dos abc.txt|uuencode abc.txt abc.txt |mail id@domain.com

Should solve it for you.

:)
Anshu
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
whiteknight
Honored Contributor

Re: mail command



Hi viseshu,

Here is the steps

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c01028039-2



WK
Problem never ends, you must know how to fix it
viseshu
Frequent Advisor

Re: mail command

Hi Anshu, thnks for ur reply. But unfortunately, giving ux2dos command is resulting in the same error. Should the reciepient use uudecode to decode it?? If so is there any alternative as im sending mail to personal mail id and they can decode that.
AwadheshPandey
Honored Contributor

Re: mail command

http://www.uaex.edu/bknox/email_with_attachment.htm
It's kind of fun to do the impossible
viseshu
Frequent Advisor

Re: mail command

Hello WK,
I could not login to the url u have given, please help me out.

Thanks
Dennis Handly
Acclaimed Contributor

Re: mail command

I also found that wordpad will read UNIX formatted .txt files.

>Anshu: ux2dos abc.txt|uuencode abc.txt abc.txt |mail id@domain.com

When you want uuencode to take it from stdin, you only want one filename:
ux2dos abc.txt | uuencode abc.txt | mail id@domain.com
Anshumali
Esteemed Contributor

Re: mail command

Here are the commands i used:

uuencode /tmp/abc.txt abc.txt | mailx -m -s "hi" id@domain.com

Your issue replicated.File as attachment with square as attachement.

but with

ux2dos abc.txt | uuencode abc.txt| mailx -m -s "hi" id@domain.com

No issue. File received in redable format without squares.

could you use the above and let me know the result. I used mailx if you noticed!!

use mailx and test. Post Results.....

PS: Please assign points if this solves. I hope i would. :)

Anshu

Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Anshumali
Esteemed Contributor

Re: mail command

You are right Dennis!
In my above example i did that..... ;)

Thanks for pointing out.
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Anshumali
Esteemed Contributor

Re: mail command

viseshu,

Dennins is correct in saying that wordpad reads the same file sucessfully while notepad isnt able to and shows squares.

You may open it with wordpad w/o issues. But most of the time default file assignment of txt files are with notepad. :)

Cheers!!
Anshu
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!