Wednesday, June 4, 2014

A Reminder: UTL_SMTP or UTL_MAIL for Sending Mail?

I thought this was worth mentioning because it is often confused by old-school Oracle developers who have survived more than one or two major releases of this RDBMS.

From the docs at Oracle [1]:
The UTL_SMTP package is designed for sending electronic mails (emails) over Simple Mail Transfer Protocol (SMTP) as specified by RFC821.
The folks at PSOUG[2] have also noted that historically, this built-in package has been around since Oracle 8i:

UTL_SMTP Package Detail: sourced from PSOUG.org
UTL_SMTP Definition[3]

The UTL_MAIL package was similarly created to replace UTL_SMTP. Both work slightly differently from one another.  Oracle announced the eventual replacement of the newer mail utility around Release of the Oracle 10g RDBMS product release.  It's definition:

UTL_MAIL Package Detail: sourced from PSOUG.org

UTL_MAIL Definition [4]
I have noticed and used UTL_MAIL since at least the 10g RDBMS Release.  Anyways, it would be wise to stick with the new replacement to add longevity to your PL/SQL procedural code which uses email features supplied by the database system.


  1. Oracle PL/SQL Documentation: UTL_SMTP
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/u_smtp.htm#i1002798
  2. (PSOUG) Puget Sound Oracle User Group
  3. UTL_SMTP History
    http://psoug.org/reference/utl_smtp.html
  4. UTL_MAIL History
    http://psoug.org/reference/utl_mail.html


No comments: