Send file with Linux

Hi,

I have scripts on AIX which send mails by the following command :

cat MyFile | mail -s "mail subject" adress@mail

these scripts send a text directly readable in the body of the mail

We are now in CENTOS 7 , and the same command , send the mail, but instead of receiving the readable text, the user receive a file xxxx.dat in the mail's body.

Is there a special parameter with Linux to retrieve the same behaviour we have in AIX ?

Thanks,

I don't know for sure, but I suspect this to be the reason: the mailing program wants a pure ASCII text only; any control character (beyond <LF> = <line feed>) makes it believe it has binary data which it adds as an attachment. Analyse your file for ctrl chars; try to send a very simple and short pure text file to verify / falsify my suspicion.

Hi, and thanks for your answer.

Yes, you are right, there are "special chars" in the file I send. These specials chars remplace the chars with accent we have in French.
At the beginning, I thougth it was a problem with the LANG parameters of both AIX and LINUX, but no, they have the same parameters.
After, I asked myself if it was not a problem of transfer from AIX to Linux (we use the rsync command). But no.

In fact, the transformation of the caracters is due to VI. I'm looking for a parameter to avoid VI to transform caracters with accents.

I know you don't have these problems in English, but If anyone has an idea....

Thanks,

Thierry

Try

iconv -tASCII//translit file

before sending file .

I found the problem. As the Linux is a "clone" of the AIX (not really, but almost), I took the same LANG parameter, but this one was wrong, at least not recognized by the Linux. When I changed for "LANG=fr_FR.iso-8859-1", VI worked fine...

Many Thanks to everybody.