Attachment getting corrupted using mailx

Hi ,

Whenever I try to mail to external email Id's ( like yahoo , gmail etc ) the attachment is getting corrupted.

In the script I am using the mailx option as follows:-

(cat $temp_mail; uuencode $temp_info_csv $temp_info_csv)|mailx -s "Report" -m $c_mail_id;

where $temp_mail is the body or text of the mail
$temp_info_csv is the report file generated
$c_mail_id is the email id referred for this report.

Can anyone point out why ?

Regards,
Sandipan

Solution is ( thanks to Pratik ) :

The approach used in the script is as follows:-

A string "[include $temp_info_csv application/msexcel base64]" is appended at the end of the body of the mail text.

Then using ELM unix mail option

cat $temp_mail|elm -s "Report" $c_mail_id;

where $temp_mail :- mail text
elm -s ( -s option if for subject of the mail)
$c_mail_id is the External email id referred for the report file $temp_info_csv.

The box which is being used has got entry for ELM version 2.4
For the first time, we just type elm from command prompt and it asks to set the Mailbox directory for the user logged in.
E.g. my Mailbox is in '/var/mail/dasp23' where dasp23 is my unix user id. This is the initial setting we have to do, so that it ELM can be invoked from shell script.

Here are the details of INCLUDE options :

[include file contenttype/subtype encoding]
The [include] has 3 arguments used to process your included files, as follows:

file
This is a file which must exist. You can specify the filename relative to your current directory, or via an absolute path.

contenttype/subtype

This section tells the recipient's mail program what type of data is being included. See the sample data types listed below.

encoding

This is an optional parameter, of which base64 and 7bit are two sample valid encoding methods.

When you place this text into your message, elm will automatically look for the file and include it in your mail message. The recipient of this mail must have the capability to read MIME (Multipurpose Internet Mail Extension) mail messages.

Regards,
Sandipan