I am not able to get the body of the mail in unix code

October 15, 2014 at 10:21:57
Specs: Windows 7
Hi I am able to attach a text file that i pick from a path and send as a mail, but i am not geting the body of the mail. Please help me get the body of the mail.
Code is as follows

# Get current date

YYYYMMDD=`date '+%Y%m%d'`
dd=`date +"%d"`
mm=`date +"%m"`
yyyy=`date +"%Y"`

# Local vars




# Get file from x server

ftp -n -i ${SRC_HOST} << END_FTP_CMD
user "${SRC_ACCT}" "${SRC_PASS}"
cd ${SRC_DIR}
prompt off
get "${SRC_FILE}"

# Exit with Priority 2
if [ ${ERR_VAL2} != 0 ]; then
echo Error getting source file.
exit 20

#uuencode ${ATTACHMENT_FILE} | mail -s ${SUBJECT} -c ${CC_LIST} ${TO_ADDRESS} -- -r ${FROM_ADDRESS}


uuencode UBHET2_ALERT_${YYYYMMDD}.txt UBHET2_ALERT_${YYYYMMDD}.txt > datafile.txt
cat $fname datafile.txt > combined.file
mailx -r x@gmail.com -s "ELIZA FILE" x@gmail.com < combined.file

# Exit with Priority 2
if [ ${ERR_VAL2} != 0 ]; then
echo Error putting source file to destination.
exit 1

Please mail me your answers at [email address removed by admin]

See More: I am not able to get the body of the mail in unix code

October 16, 2014 at 07:13:32
Just FYI,

I removed your email address from above post in order to (hopefully) save you from a bucket load of spam. It's never a good idea to publicly broadcast your email or IP address in a forum like this. Well ok, publicly anywhere on the internet!

Also, we do not supply responses via email as it defeats one of the major purposes of a tech help forum like this. The purpose in question being, allowing others to search for answers through the forum before asking questions (many have been asked and answered previously).

If we all answered via email, all there would be here is questions. That wouldn't be much help to anybody would it.

It matters not how straight the gate,
How charged with punishments the scroll,
I am the master of my fate;
I am the captain of my soul.

***William Henley***

Report •

October 16, 2014 at 07:23:43
Thank you for removing my mail address. I understand that it wont help others if i get the answers through my mail. Thanks once again. It would be great is i get the answer for the question i posted.

Report •

October 17, 2014 at 07:02:59

According to this link:


I think that you are using the uuencode/mailx commands correctly. But I don't see where $fname is defined? If $fname is not defined, there is no body to the mail.

Finally, let me say two other things about your script:

First, in the Korn shell, ksh, to compare strings use "=" for equal and "!=" for not equal; to compare numbers use "-eq" for equal, "-ne" for not equal, "-gt" for greater than and "-lt" for less than.

Second, you will probably save yourself later trouble by placing quotes around your strings:

echo "Error putting source file to destination."

Let me know if you have any further questions.


message edited by nails

Report •
Related Solutions

Ask Question