Quote Originally Posted by ramaral View Post
If the file is too big then check out this page for ideas.
http://www.shelldorado.com/articles/...tachments.html

or do something like uuencode the file and pipe it to mailx (something like mentioned in the article but using mailx instead of mail or metasend)

OR

try this sample script:

#!/bin/ksh

# -----------------------------------------------------------------------
# Filename: mailx.ksh
# Purpose: Demonstrates how one can attach files when sending E-Mail
# messages from the Unix mailx utility.
# Author: Frank Naude ([email protected])
# -----------------------------------------------------------------------

SUBJECT="Send mail from Unix with file attachments"
TO=frank\@ibi.co.za
SPOOLFILE=/tmp/sqlplus.txt

echo "Produce listing from SQL*Plus..."
sqlplus -s scott/tiger >$SPOOLFILE <<-EOF
set echo off feed off veri off pages 0 head off
select * from tab;
EOF

# echo "Convert file to DOS mode..."
# unix2dos $SPOOLFILE $SPOOLFILE 2>/dev/null

echo "Send the E-mail message..."
/usr/bin/mailx -s "${SUBJECT}" ${TO} <<-EOF
Hi,

This sample E-mail message demonstrates how one can attach
files when sending messages with the Unix mailx utility.

First attachment: SQL*Plus spool file
~< ! uuencode $SPOOLFILE `basename $SPOOLFILE`

Second attachment: mailx.ksh (this script)
~< ! uuencode mailx.ksh mailx.txt

Third attachment: /etc/passwd file
~< ! uuencode /etc/passwd passwords

Best regards

~.
EOF

echo "Done!"


Found at http://www.orafaq.com/scripts/unix/mailx.txt

[Edited by ramaral on 08-09-2002 at 08:36 AM]
ramaral, I trued this in UNIX (Solaris) it email me the message as a body, the line ~< ! uuencode is not running the uuencode? am I missing something?
Basicly, I received the email with the ~< ! uuencode as a line?
Regards
Joe