RE: Attachment in PLSQL

  • From: "FENOLL Vincent (FR/EXT-SIF-FOCAL)" <vincent.fenoll@xxxxxxx>
  • To: "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 12 May 2004 15:17:49 +0200

Another way to send an email with attachment in a shell script with =
mailx

#!/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, Oracle FAQ
# =
-----------------------------------------------------------------------

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@xxxxxxxxxxxxxxx]
Envoy=E9 : mardi 11 mai 2004 17:08
=C0 : oracle-l@xxxxxxxxxxxxx
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
send as an attachement to the Remote location.=20
--=20
Mladen Gogala
Oracle DBA



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.

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //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@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: