Send file with Linux


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Send file with Linux
# 1  
Old 10-15-2018
Send file with Linux

Hi,

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

Code:
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,

Last edited by Corona688; 10-15-2018 at 01:05 PM.. Reason: Code tags for code please
# 2  
Old 10-15-2018
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.
# 3  
Old 10-16-2018
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
# 4  
Old 10-16-2018
Try
Code:
iconv -tASCII//translit file

before sending file.
# 5  
Old 10-16-2018
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to configure mutt to send emails on Linux.?

Hello, I am trying to use mutt in order to send emails. I have installed mutt using yum and pasted some details about it later in the post. When I try to run: echo test | mutt -s "Test Email" user@id.com It doesn't do anything. I dont receive any emails. I have the SMTP details for... (1 Reply)
Discussion started by: vaibhavraj
1 Replies

2. Programming

Unable to send email using Java in Linux

Hi All, We recently moved to Red Hat Enterprise Linux Server release 6.6 from Solaris 10. The existing Java code to send emails in Solaris is public class card_cardMessenger{ /** * Send an e-mail message via the Runtime class * @see Runtime * @return boolean (success or failure of... (1 Reply)
Discussion started by: Meghan2525
1 Replies

3. Programming

How to send a file in e-mail from on Linux C++?

Hi ! I-m copile from source a C++ program from tutorials from internet. I don't understendig any programing languages.. but compiled aplication running ok. I-ts possible to add in my used program, lines to send one file from config directory in e-mail, to my e-mail adress ? I want to run... (2 Replies)
Discussion started by: kraftwerk
2 Replies

4. Shell Programming and Scripting

How to use expect and send command in UNIX/Linux?

Hello Everyone, I am executing a unix script which logs into 50+ servers (netapp servers) and runs some commands and captures output locally. Below is the code snippet. file1.txt has names of all the remote servers where I am logging in. #!/bin/ksh #!/usr/bin/expect touch... (1 Reply)
Discussion started by: rahul2662
1 Replies

5. UNIX for Dummies Questions & Answers

Possible to send an email to a Linux Server?

Hello All, I was curious if its possible to send an email (in reverse) to a linux server from an email client (like Lotus Notes, Outlook, etc...)? I know it's possible to send an email FROM a Linux Server TO a email address, but I tried to just 'reply' to the Linux Servers address that sent... (8 Replies)
Discussion started by: mrm5102
8 Replies

6. IP Networking

How to send non get request from linux server

Hi I want to send non get request for HTTP from linux server. Please let me knwo how to do that Thanks Lakshmikant (0 Replies)
Discussion started by: lakshmikant
0 Replies

7. UNIX for Dummies Questions & Answers

How to send email attachment as read only in Linux

Hi, Could anyone help me to find soultion for the issue to send email attachment as read only. I can change the file permission in Linux and can send the email attachment from Linux. But my requirment is user can read the attachment but should not modified it . even user save the attachment... (4 Replies)
Discussion started by: calagar
4 Replies

8. Red Hat

not able to send mails from linux

I am using centOS 5.3 as server, and i hav installed sendmail-8.13.8-2.el5.i386. But still, m not able to send mails to outer domain. Do i need to configure DNS for this? PLease suggest a step by step guide, if u hav, for the concern, as i m new to linux and sendmail as well.. thanks (1 Reply)
Discussion started by: oracle.test2
1 Replies

9. Shell Programming and Scripting

Send attachment in Linux

Hi, I have searched the site for info on sending an attachment in Linux, have tried a few people mailx codes but to no success. Can someone please help me? This is what i have so far: #!/bin/bash user_mail_address="me@yahoo.com" filename="attachment.txt" body="This is the body" mail -s... (6 Replies)
Discussion started by: shamushamu
6 Replies

10. Shell Programming and Scripting

Send mail from linux

Hi, Could any one get me suggested how to send a mail from a linux server to any external user? I tried the following : $ mail abc@xyz.com Subject: test Hi, This is a test mail. . Cc: def@xyz.com But I haven't recived any mail at abc@xyz.com and def@xyz.com Kindly help on... (2 Replies)
Discussion started by: yogi_4984
2 Replies
Login or Register to Ask a Question