'Oracle APEX - Invalid lob when calling to APEX Apex_mail.send

I have a Oracle Database 18c Standard Edition 2 Release 18.0.0.0.0 server with Oracle apex 19 running on a Linux box.

I am testing send emails with templates build on Apex. If I run the below code I get a error

begin

  Apex_mail.send(p_application_id     => 100,
                 p_to                 => '[email protected]',
                 p_from               => '[email protected]',
                 p_template_static_id => 'TEST',
                 p_placeholders       => '{"count":1}');
end; 

ORA-06502: PL/SQL: error : invalid LOB locator specified: ORA-22275 numérico o de valor
ORA-06512: en "SYS.DBMS_LOB", línea 727
ORA-06512: en "APEX_190100.WWV_FLOW_MAIL", línea 776
ORA-06512: en "APEX_190100.WWV_FLOW_MAIL", línea 849
ORA-06512: en "APEX_190100.WWV_FLOW_MAIL", línea 873
ORA-06512: en "APEX_190100.WWV_FLOW_MAIL_API", línea 88
ORA-06512: en línea 3

I've tested same code in other Oracle server without problem.

If I call to the overloaded function of APEX_mai.send as bellow, it work fine.

begin
  
  apex_mail.send(p_to   => '[email protected]',
                 p_from => '[email protected],
                 p_body => 'Main email text goes here',
                 p_subj => 'APEX_MAIL - Plain Text message');
  Apex_Mail.push_queue;
end;

Note: Application 100 and template "TEST" exists in my apex workspace

My question, what is the problem in my code when I use template?

I have tried sending an empty placeholder, but I get the same result



Solution 1:[1]

I found the problem, For some strange reason, the "text plain" template should not be empty, I added a "."(yes, a simple dot) in the template with plain text and it started working.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pedro Luque