1834591 Members
3587 Online
110069 Solutions
New Discussion

mailx

 
SOLVED
Go to solution
Dave La Mar
Honored Contributor

mailx

Sorry people. I know there are a lot of posts on this and I have read many, but obviously not the correct one.
Problem:
uuencode /path/file.name newfile.txt | mailx
-m -s "Subject" xxxx@xxxx.com

file.name has many lines of text.
newfile.txt when received as an attachment contains all the lines of test in one line.
There seems to be no translation of cr lf.
mailx.rc contains - set charset=X-roman8
set charset=us-ascii
What am I missing?
I can use elm but wish to solve this first.
Thanks for any input.

"I'm not dumb. I just have a command of thoroughly useless information."
8 REPLIES 8
MANOJ SRIVASTAVA
Honored Contributor

Re: mailx

Hi Dave

Try

mailx -s "SUBJECT" abc@xyz.com < < file name>

Manoj Srivastava

Dave La Mar
Honored Contributor

Re: mailx

Thanks for the suggestion Manoj Srivastava,
but that will put the text in the body of the email and not as an attachment.
dl
"I'm not dumb. I just have a command of thoroughly useless information."
MANOJ SRIVASTAVA
Honored Contributor

Re: mailx

Hi Dave


add the following to the .profile of the user and you will get the attachement

export NLS_LANG="spanish"_spain.we8dec
export NLS_LANG=AMERICAN_AMERICA.US7ASCII
export LANG=es_ES.iso88591

I have also added the .profile of the user from where I get the atachements .

Manoj Srivastava
Dave La Mar
Honored Contributor

Re: mailx

Thanks for the input. I will add the language parms as needed.
As it turns out the problem was in opening the document in word pad.
Translation of cr and lf seem to be fine when using MS Word or ultra edit.
Rookie error.
"I'm not dumb. I just have a command of thoroughly useless information."
Dave La Mar
Honored Contributor

Re: mailx

The culprit was note pad not word pad as stated.
dl
"I'm not dumb. I just have a command of thoroughly useless information."
Laurent Paumier
Trusted Contributor
Solution

Re: mailx

uuencode was designed to encode binary files. It will not convert line feeds. You should convert the file before encoding it :

# ux2dos /path/file | uuencode newfile.txt | mailx -m -s "Subject" xxxx@xxxx.com
Dave La Mar
Honored Contributor

Re: mailx

Thanks you Laurent Paumier. Actually though it works as I currently use it, your suggestion seems to be the appropriate way. I noticed this allowed even notepad to open the document successfully.
Thnaks again.
"I'm not dumb. I just have a command of thoroughly useless information."
Bill Hassell
Honored Contributor

Re: mailx

Notepad is a simple ASCII text editor while WordPad and Word, et al are word processors. A plain ASCII file in DOS or Windows requires CR/LF pairs to conform. Word processors such as Wordpad see the lone LF character as a soft carriage return, which is meaningful in formatting paragraphs. Notepad just shows the single LF as a black square.

You can select all the text in Wordpad or Word with CTRL-A and then copy the data to the Clipboard. Start Notepad and paste the Clipboard contents and all will be fixed.

As this is a bit too complex for most users, just use ux2dos in your mailx command line to conver the file to a standard ACII file foe PCs.


Bill Hassell, sysadmin