Problem with uuencode

Hi,

I am trying to send an attachment through UNIX to the mail box. But along with the attachments I am also receiving junk data as a text file, Suppose "Hi" is the subject of the mailx command then along with the attachment I am getting Hi.txt also.

Below are the commands which I used : -

mailx -s "Hi" myid@doma.com << EOF
`uuencode myFile.CSV myFile.CSV`
EOF

The Hi.txt file contains : -

`
end

Please advise.

uuencode myFile.CSV myFile.CSV | mailx -s "Hi" myid@doma.com

try this ..

$ uuencode myFile.csv myFile.csv | mailx -s "Hi" abc@xyz.com 

Hi,

Thank you for your reply.

I am still getting the junk data.

Please advice.

Is the file is readable in unix ? and is csv file is generated in windows ?

The Hi.txt file contains below data : -

`
end

and *.CSV file data is also readable which is generated throgh informatica.

Hello All,

Due to some unknown ( to me atleast ) , I too getting the junk data with this approach.

uname -a
HP-UX avalon B.11.11 U 9000/800 3547052374 unlimited-user license

Below worked for me with sendmail command

 
(echo "Subject : Hi"
 echo "Hi , This is a test mail"
 uuencode myFile.CSV myFile.CSV) | /usr/sbin/sendmail emailid 

Thank you for your reply.

I am still having the same problem. Please adive.

$ uname -a
Linux CORNERSTONE 2.6.18-128.1.14.el5 #1 SMP Mon Jun 1 15:52:58 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

You mean, even with sendmail , you are getting a junk file "Hi.txt" as an attachment?

Regards
Ravi

Hi Ravi,

Yes..Even after changing the code also I am getting the Hi.txt file.

(echo "Subject : Hi"
echo "Hi , This is a test mail"
uuencode myFile.CSV myFile.CSV) | /usr/sbin/sendmail myID@doma.com

Please advise

strange, !!!. Try with out subject line ( changing subject line )/Body and by sending only mail with attachment.

Hi Ravi,

I tried without subject line, this time I got ATT00063.txt along with myFile.CSV.

the ATT00063.txt file contains the same junc data.

`
end

Code : -

(echo "Hi , This is a test mail"
uuencode myFile.CSV myFile.CSV) | /usr/sbin/sendmail myID@doma.com

---------- Post updated at 01:16 PM ---------- Previous update was at 07:29 AM ----------

Hi,

Could you please help me on this.

~Smith

---------- Post updated at 07:12 PM ---------- Previous update was at 01:16 PM ----------

HI,

Could you please advise me is there any alternative way to overcome this issue or is it possible to use any other command which will send an attachment without any junk data.

please advise.

When you send this email through sendmail/mail from UNIX, does it by any chance get routed to an exchange server for delivery to your inbox? If yes, then the ATT*.txt with junk is probably being converted or added by the exchange server.

Look at this URL on the same and a possible solution that your exchange admin will need to set.

1 Like

When I execute the script I am getting .CSV and also att.txt files (att*.txt --> when there is no subject in mailx, if "Hi" is the subject then Hi.txt) attached and coming to my inbox.

I am not sure if the att*.txt has been created by the exchange server.

The att*.txt file contains only 2 lines dara : -

`
end

I need your kind support how to overcome this issue, is there any alternative commnnd which sends only *.csv, please share your thoughts, I will modify my code accordingly.

Thanks for your support

Also Try,

uuencode myFile.csv myFile.csv | mailx -m -s "Hi" abc@xyz.com

I am getting the below erorr message : -

Code : -
uuencode myFile.CSV myFile.CSV mailx -m -s "Hi" myid@doma.com

Error: -
mailx: invalid option -- m
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
[-- sendmail-options ...]
mail [-iInNv] -f [name]
mail [-iInNv] [-u user]