ERROR at line 1: ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.UTL_MAIL"

(Doc ID 1119480.1)

Last updated on AUGUST 28, 2017

Applies to:

PL/SQL - Version 11.2.0.1 and later
Information in this document applies to any platform.
***Checked for relevance on 24th Aug 2017***


Symptoms

Sample scenario:

BEGIN
UTL_MAIL.send(sender => 'rob.moy@oracle.com', recipients => 'rob.moy@oracle.com', cc => '', bcc => '', subject => 'UTL_MAIL Test', message => 'Message sent successfully!');
END;
/


Gives an error similar to the below message.

BEGIN
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.UTL_MAIL", line 654
ORA-06512: at "SYS.UTL_MAIL", line 671
ORA-06512: at line 2

Changes

Please check and see if the required database parameter is set and is correct. See the below information:

show parameter smtp_out_server



NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
smtp_out_server string


Set your SMTP_OUT_SERVER database parameter to your SMTP mail server using the alter command.

alter system set smtp_out_server='mail.oracle.com';



System altered.

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms