ORA-29261: Bad Argument In APEX_MAIL.SEND Function (Doc ID 1583393.1)

Last updated on NOVEMBER 14, 2016

Applies to:

Oracle Application Express (formerly HTML DB) - Version 4.2.0.00.27 and later
Information in this document applies to any platform.

Symptoms

On : 4.2.0.00.27 version, Administration

When attempting to sent an email from any apex application, the following errors occur:

ERROR
-----------------------
ORA-29261: bad argument
and after several similar errors in the apex mail queue the follow error is also seen
ORA-30678: too many open connections


STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. Send email using inside apex (sql*workshop or application) code like
DECLARE
l_id NUMBER;
l_to varchar(90);
BEGIN
SELECT 'validuser@smtphostname.domain'
INTO l_to
FROM dual;
l_id := APEX_MAIL.SEND(
  p_to => l_to ,
  p_from => 'valid_source@smtphostname.domain',
  p_subj => 'Test Appointment Notice',
  p_body => 'You have a new appointment:');
APEX_MAIL.push_queue;
END;

2. The email is not sent but showed in the email queue with error

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