Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Attachment in PLSQL
Another way to send an email with attachment in a shell script with = mailx
#!/bin/ksh
# =
SUBJECT=3D"Send mail from Unix with file attachments"
TO=3Daddress\@domain.com
SPOOLFILE=3D/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=20 select * from tab; EOF
# echo "Convert file to DOS mode..."
unix2dos -ascii $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=20 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!"
-----Message d'origine-----
De : Mladen Gogala [mailto:mladen_at_wangtrading.com]
Envoy=E9 : mardi 11 mai 2004 17:08
=C0 : oracle-l_at_freelists.org
Objet : Re: Attachment in PLSQL
This is, probably, what you are looking for:
http://www.smashing.org/extproc_perl
Once you get it up and running, there is something called MIME::Lite =
that
can be used to=20
attach objects to messages.
On 05/11/2004 10:34:27 AM, Sanjay Mishra wrote:
> Hi > =20 > I am creating a text file in UTL_FILE_DIR in 8i[8.1.7] which I need =to
Note:
This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission. =
If
you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and notify =
the
sender. You must not, directly or indirectly, use, disclose, =
distribute,
print, or copy any part of this message if you are not the intended
recipient. Wang Trading LLC and any of its subsidiaries each reserve =
the
right to monitor all e-mail communications through its networks.
Any views expressed in this message are those of the individual sender,
except where the message states otherwise and the sender is authorized =
to
state them to be the views of any such entity.
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html ----------------------------------------------------------------- ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: http://www.orafaq.com ---------------------------------------------------------------- To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line. -- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Wed May 12 2004 - 08:15:00 CDT
![]() |
![]() |