My Oracle Support Banner

How to Send Any Type of Attachment with UTL_MAIL (Doc ID 946811.1)

Last updated on JANUARY 29, 2022

Applies to:

PL/SQL - Version and later
Information in this document applies to any platform.


To show you how to use the UTL_MAIL package to send any type of attachment:

  • Text-Based
  • Binary-Based

using one simple PL/SQL stored procedure.

While there are two procedures that can be used to send attachments


only one of them is truely needed as SEND_ATTACH_RAW can send both Text-Based and Binary-Based attachments and will be used in the sample code below.

Note: Before running this sample code UTL_MAIL must be properly configured.  Refer to the PL/SQL Packages and Types Reference section on UTL_MAIL for more information on how to configure this package or contact your DBA for help.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.