Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » APEX_MAIL doesn't send my email with clob content (ApEx 3.1, Oracle DB 10g)
icon5.gif  APEX_MAIL doesn't send my email with clob content [message #320881] Fri, 16 May 2008 10:20 Go to next message
c_stenersen
Messages: 255
Registered: August 2007
Senior Member
I want to send an email to users with a list of alarms defined for entities in the database. There are many alarms, and the email is not sent. When I limit the length of the clob it is sent. It seems it won't send the email if the text is above a certain length, even if it's a clob (and the APEX_MAIL documentation says it's possible to send emails with clobs). Using a varchar2 is not an option. The texts are too long. I get no exceptions, the email is simply not sent. Sad

Is there anyone who has had the same problem (and has a solution for it)?

Example:
create or replace
procedure email_testing is
    test_text clob;
begin
    for i in 1..328 loop --Gives more than 32800 characters
        test_text := test_text 
                     || '12345678901234567890'
                     || '12345678901234567890' 
                     || '12345678901234567890' 
                     || '12345678901234567890'
                     || '12345678901234567890' 
                     || utl_tcp.crlf; 
        --add 100 characters plus a linefeed
    end loop;

    APEX_MAIL.send(
            p_to => 'somename@someserver.com',
            p_from => 'somename@someserver.com',
            p_body => test_text,
            p_body_html => '<html><head></head><body>' || test_text || '</body></html>',
            p_subj =>  'test text');
        
    APEX_MAIL.push_queue;
end email_testing;

The email is not sent.
But if the for loop condition is "i in 1..319", the email is sent, so it seems the limit is the max length of a varchar2.

I've also tried using the dbms_lob package to create a temporary clob, and then appending data to it by using the writeappend procedure, but the result is still the same.

Any ideas? Does anyone else have the problem, or is it some problem only on the server I'm using?
Re: APEX_MAIL doesn't send my email with clob content [message #321852 is a reply to message #320881] Wed, 21 May 2008 10:08 Go to previous message
c_stenersen
Messages: 255
Registered: August 2007
Senior Member
Apparently it's just the server. It sends the emails with the long texts in the production database, but not in the test database. I don't know why though.
Previous Topic: Error in viewing Oracle XE Home page
Next Topic: Starting 10g
Goto Forum:
  


Current Time: Thu Mar 28 20:35:30 CDT 2024