The Oracle (tm) Users' Co-Operative FAQ

How do I send an email from PL/SQL, possibly with attachments?


Author's name: see below

Author's Email: see below

Date written: 17/10/01

Oracle version(s): 8.1.6 and later

It is often desirable for a long running PL/SQL program to be able to send an email to a designated recipient, possibly including a file of results. Although this can be done by wrapping the procedure in a shell-script or BAT file, it is more elegant to send the email direct from the PL/SQL procedure. Oracle versions 8.1.6 and later include the UTL_SMTP package for doing this, but you need to know a bit about SMTP to use it, and it doesn't lend itself to easily sending attachments. Is there a simple way to send an email from PL/SQL, with attachments, without having to understand how SMTP works?

Back to index of questions


This question is addressed by the following documents:

Author

Title/URL

Suggested by

Dave Wotton,

enhanced by

Barry Chase

mail_files: an Oracle PL/SQL procedure to send an email with file attachments . The original for this package has disappeared from the web, so the link now points to a version of the code that has been enhanced over the years by Barry Chase.

Dave Wotton (17/10/01)

 

 

 

.


Further reading: Oracle8i Supplied PL/SQL Packages Reference Release 2 (8.1.6) (available at Oracle Technet)


Back to top

Back to index of questions