user495381
user495381

Reputation: 61

oracle utl_mail message body size limit

I am using the utl_mail procedure in oracle 10.x and have noticed that if I try to pass a value with a length of more than 4000 characters into the varchar2 input for Message, I get an error: 4000 works, 4001 fails. Is this a hard-coded limit, or is there a setting somewhere that I can change to increase this? I would have thought it would be 32000 limit...

thanks for any and all help mike

Upvotes: 4

Views: 3851

Answers (2)

Jeffrey Kemp
Jeffrey Kemp

Reputation: 60272

UTL_MAIL is a simple wrapper over UTL_SMTP, it's only generally used for short simple emails.

UTL_MAIL.SEND (
   sender      IN    VARCHAR2,
   recipients  IN    VARCHAR2,
   cc          IN    VARCHAR2 DEFAULT NULL,
   bcc         IN    VARCHAR2 DEFAULT NULL,
   subject     IN    VARCHAR2 DEFAULT NULL,
   message     IN    VARCHAR2,
   mime_type   IN    VARCHAR2 DEFAULT 'text/plain; charset=us-ascii',
   priority    IN    PLS_INTEGER DEFAULT NULL);

If you use UTL_SMTP instead, you can send emails of arbitrary length, by repeated calls to UTL_SMTP.DATA.

Upvotes: 5

Randy
Randy

Reputation: 16677

varchar2 is limited to 4000

Upvotes: 1

Related Questions