Error in creating the body of HTML for Email with attachment

I have an application where I send emails with an attachment. It seems to work very well. I'm now add content to the body of the Email and I'm running on about how set up the body. To test, I created a small amount of html code which is placed in part p_body_html of the script send mail, but because it's going to be a little (more than 1000 characters) to create the real html table, I'm trying to create in a declared variable and then have the p_body_html call the variable l_body_html and that's where I'm running into the following error message :

1 error has occurred
* ORA-06550: line 9, column 9: PLS-00307: too many statements of 'SEND' fits this call
ORA-06550: line 9, column 1: PL/SQL: statement ignored

Code that works is:
 
DECLARE
    l_id NUMBER;
    l_body_html CLOB;
BEGIN
l_id := APEX_MAIL.SEND(
        p_to        => :P4_TO,
        p_from      => '[email protected]',
        p_body      => 'Please review the attachment.',
        p_body_html => '<html><head></head><body><table width="615" border="0" align="center" cellpadding="0" cellspacing="0" RULES=NONE FRAME=BOX style="cellpadding:0 cellspacing:0"><tr><td height="32" colspan="2" bgcolor="#FF0000">Information</td></tr><tr><td colspan="2">Testing</td></tr><tr><td>One</td><td>Two</td></tr></table></body></html>',
        p_subj      => :P4_TITLE);
FOR c1 IN (SELECT filename, attachment, mimetype 
        FROM ATTACH_EMAIL
        WHERE recordid = :P4_recordid) LOOP

        APEX_MAIL.ADD_ATTACHMENT(
            p_mail_id    => l_id,
            p_attachment => c1.attachment,
            p_filename   => c1.filename,
            p_mime_type  => c1.mimetype);
        END LOOP;
    COMMIT;
END;
The code that does not work is:
DECLARE
    l_id NUMBER;
    l_body_html CLOB;

BEGIN
l_body_html :='<html><head></head><body><table width="615" border="0" align="center" cellpadding="0" cellspacing="0" RULES=NONE FRAME=BOX style="cellpadding:0 cellspacing:0"><tr><td height="32" colspan="2" bgcolor="#FF0000">Information</td></tr><tr><td colspan="2">Testing</td></tr><tr><td>One</td><td>Two</td></tr></table></body></html>';

l_id := APEX_MAIL.SEND(
        p_to        => :P4_TO,
        p_from      => '[email protected]',
        p_body      => 'Please review the attachment.',
        p_body_html => l_body_html,
        p_subj      => :P4_TITLE);
FOR c1 IN (SELECT filename, attachment, mimetype 
        FROM ATTACH_EMAIL
        WHERE recordid = :P4_recordid) LOOP

        APEX_MAIL.ADD_ATTACHMENT(
            p_mail_id    => l_id,
            p_attachment => c1.attachment,
            p_filename   => c1.filename,
            p_mime_type  => c1.mimetype);
        END LOOP;
    COMMIT;
END;
I said the l_body_html as CLOB then I fill it with code and then I reference it the p_body_html. I have this work under other forms of e-mail with no attachments and it works fine. Don't know how I have too many statements as the error States and would appreciate any help

Thank you
Wally
Advertisement

Hi Wally,

The SEND() function may take varchar2s or CLOB to p_body and p_html_body. In your code, you declare l_body_html as a CLOB, but assigning a string. It is possible that the database is confused?

Try to use TO_CLOB ('...') to set the value of l_body_html

Andy

Tags: Database

Similar Questions

  • Call for email with attachment - broke up with 10.2?

    The following used to work properly on 10.1, but on 10.2, the call fails.

        attachedObjects: [
            Invocation
            {
                id: emailQuery
                query
                {
                    invokeActionId: "bb.action.SHARE"
                    mimeType: "*"
                    invokeTargetId: "sys.pim.uib.email.hybridcomposer"
                }
                onArmed:
                {
                    trigger("bb.action.SHARE");
                }
            }
        ]
    
        function shareFiles(s)
        {
            console.debug("file://" + s)
            emailQuery.query.uri = "file://" + s;
            emailQuery.query.updateQuery();
        }
    

    and returns to the console log.

    file:///accounts/1000/shared/documents/mydatafile.csv
    InvocationWrapper::onQueryFinished: no matching result from Menu Service for query
       mimeType="*"
       uri=QUrl("file:///accounts/1000/shared/documents/mydatafile.csv")
       data= ""
       metadata= QMap()
       perimeter= 0
       action= "bb.action.SHARE"
       target= "sys.pim.uib.email.hybridcomposer"
       invokerIncluded= false
    InvocationPrivate::onQueryResolved: no result matching query, no armed signal sent.
    

    Any suggestions... Tried a different approach when searching for different thread related to the topic but so far no luck...

    This is confirmed to not work in 10.2 (wire)

    I had questions about the year 10.0 with her last and switch to a version of c ++ which is still working on the last update

    * Assuming a context property is set in this example, it is RPC.

    applicationUI.cpp

    #include 
    #include #include 
    
    using namespace bb::system;
    
    void ApplicationUI::email()
    {
        InvokeRequest request;
        request.setAction("bb.action.COMPOSE");
        request.setMimeType("message/rfc822");
        QVariantMap data;
        data["to"] = (QVariantList() << "[email protected]");
        data["subject"] = "Message Title";
        QVariantMap moreData;
        moreData["data"] = data;
        bool ok;
        request.setData(bb::PpsObject::encode(moreData, &ok));
        InvokeManager manager;
        manager.invoke(request);
    }
    

    applicationUI.hpp

    namespace bb
    {
        namespace cascades
        {
            class Application;
            class LocaleHandler;
        }
        namespace system
        {
            class InvokeManager;
        }
    }
    
    public:
        ApplicationUI(bb::cascades::Application *app);
        virtual ~ApplicationUI() { }
    
        Q_INVOKABLE void email();
    

    . QML

    Button {
       onClicked: {
         cpp.email();
      }
    }
    

    * I belive files may be attached, if you add in the table of data of QVariantMap, I think that should do the trick

    data["attachment"] = "file:///path/to/my/item.txt";
    
  • Standalone downloaded lightroom 6 on a MacBook Pro. Impossible to get a program to open - an internal error cannot create the required folder.

    Downloaded standalone 6 Lightroom on a MacBook Pro. Impossible to get a program to open - an internal error cannot create the required folder. Any suggestions about how to proceed?

    Hi woodysk

    Greetings.

    • You will need to read and write permissions on the Adobe folders manually.

    Please follow the steps below:

    • Right-click on the icon in the Finder and select the 'Go - To' folder option.
    • You will get a text box, type in the following command and then press the 'return '. (Don't miss ~ symbol)
      • ~/Library
    • Then go to the Application Support > Adobe.
    • Right-click on the Adobe folder, then select the GetInfo.
    • Expand the section sharing & permissions.
    • Click on the padlock icon in the lower corner on the right. Enter your administrator user name and password when you are prompted, and then click OK.
    • Please click on '+' symbol, it will open the list of user accounts.
    • Add all of the user accounts and then give permission to "Read & write" to all user accounts. (If not agree, just add currently logged in username and administrator)
    • Click the gear icon and select apply to closed. Close the dialog box for information.
    • Then launch Lightroom application and check.

    Let me know if still face you any issue.

    Concerning

    Rohit

  • I want to know how to create the account admin hiden for my laptop.

    original title: admin account

    I want to know how to create the account admin hiden for my laptop.

    She has windows vista. I'm the only Admin and the only user. No other person has access.

    The hidden account called administrator is already present.  To activate it:

    1. Click on Start > all programs > Accessories .
    2. Right click on command prompt .
    3. Click run as administrator .
    4. In the command prompt window, type net user administrator / Active: Yes
    5. Press enter .

    Boulder computer Maven
    Most Microsoft Valuable Professional

  • Recovery of the class factory COM for component with CLSID {3CE74DE4-53D3-4D74-8B83-431B3828BA53} failed due to the following error: 80040154

    When I run pdf reader applications, I get this error:

    Recovery of the class factory COM for component with CLSID {3CE74DE4-53D3-4D74-8B83-431B3828BA53} failed due to the following error: 80040154

    Hello

    1. you remember to make changes to the computer before this problem?

    2 are you able to open files from other Adobe programs?

    Follow these methods.

    Method 1: The problem is that by default, when the PDF program is used as a COM object, then it cannot be activated by the following accounts:

    (a) a Director

    (b) system

    (c) interactive

    How to solve this problem is to change the DCOM settings for the Application'S object.

    Configure DCOM

    a. click Start, type run in the start search field.

    b. type DCOMCNFG , and then press OK. (This will load the "Component Services")

    c. navigate to Component Services, click computers, my computer, DCOM Config application PDF.

    d. right-click and select Properties.

    e. Select the Security tab.

    f. in "Launch and activate permissions" select personalise and press change.

    g. press the Add button to select the "Network Service" account

    f. click on the OK button, and then test your application, it should work fine now.

    Method 2: If this does not help, you can uninstall and reinstall Adobe reader software and check.
    http://Windows.Microsoft.com/en-us/Windows7/uninstall-or-change-a-program

    You can download the latest version of Adobe reader from the following link.
    http://get.Adobe.com/reader/

  • Bulletins of update error: ' error: failure of the verification of signatures for: message XML Update SQL.

    Hi all

    I get this error when when looking for Windows newsletters (Patching-> Windows-> news-> news-> control upgrade). Looking at the Task Manager, I see "error: failure of the verification of signatures for: message XML Update SQL.

    I use the latest version vCM 5.8.2. I found another post here on this subject, which mentioned that the KB 2050220 fixed the problem, but it does not work for me .

    You have any other ideas I could try? Where would the real logs that could help me understand what the problem?

    Thank you.

    Well, what it fixed.  Looked in the debugging information, and indeed it was related to the KB 2050220:

    Level: error

    Time: 17/04/2016 10:53:43:460

    ClassName: clsPatchVerification

    FuncName: VerifyPatch

    MSG: (0) downloaded the file: C:\Program Files (x86)\VMware\VCM\Sum\Collector\SUM2_postxml.sql.cab has not a signature of trust manager of Configuration of VMware. Certificate IssuedTo: The issuer of the certificate VMware, Inc.: SHA2 DigiCert assured ID Code signing CA

    SourceDesc: UI

    RequestId: default

    JobId:

    JobMachineName:

    The problem with the added SQL KB is it is old... is no longer reflecting the reality, as the certificate of the cabin has now SHA2 DigiCert assured ID Code Signing CA, and not DigiCert assured ID Code Signing CA - 1 as written in the query SQL attached to the KB.

    That's why we:

    Original VMware KB:

    SET QUOTED_IDENTIFIER ON

    SET ANSI_NULLS

    IF NOT EXISTS

    (

    SELECT *.

    OF dbo.ecm_sysdat_certificate_configuration_settings_ui

    WHERE configuration_name = "DigiCert assured ID Code Signing CA - 1"

    )

    BEGIN

    INSERT INTO dbo.ecm_sysdat_certificate_configuration_settings_ui

    (

    configuration_name,

    configuration_description,

    is_subject,

    is_issuer,

    is_configuration_allowed,

    last_modified_by_id,

    last_modified_datetime

    )

    VALUES

    (

    "DigiCert assured ID Code Signing CA - 1",

    NULL,

    0,

    1,

    1,

    NULL,

    NULL VALUE

    )

    END

    GO

    FIX:

    SET QUOTED_IDENTIFIER ON

    SET ANSI_NULLS

    IF NOT EXISTS

    (

    SELECT *.

    OF dbo.ecm_sysdat_certificate_configuration_settings_ui

    WHERE configuration_name = "SHA2 DigiCert assured ID Code Signing CA"

    )

    BEGIN

    INSERT INTO dbo.ecm_sysdat_certificate_configuration_settings_ui

    (

    configuration_name,

    configuration_description,

    is_subject,

    is_issuer,

    is_configuration_allowed,

    last_modified_by_id,

    last_modified_datetime

    )

    VALUES

    (

    "DigiCert assured SHA2 Code ID signing CA",

    NULL,

    0,

    1,

    1,

    NULL,

    NULL VALUE

    )

    END

    GO

  • There was an error in creating the temporary file

    (Signature) certificate not saved to the file, as says the answer "there was an error in creating the temporary file.  Opening of the applied wa file says which no valid signing certificate.

    When the file has been saved to a local drive, the certificate has been accepted...

  • Cannot reduce the size of photos for emailing - no email partner program

    I click on the photo folder, click send to, click on the message, reduce the size, fix and POP UP APPEARS says there is no e-mail program associate, if please install or go to the default program and create an association.  I can send an original email size 4 MB, but can not send too much of. I have Windows 7. What should I do. ?

    Moved from feedback

    Original title: cannot reduce the size of photos for emailing.

    Hello

    Windows 7 came with a pre-installed email program.

    If you have installed one?
    Windows Live Mail is popular
    http://explore.live.com/Windows-Live-Essentials?OS=other
    Is Thunderbird http://www.mozilla.org/en-US/thunderbird/

    After installing an e-mail program, make sure you have a default e-mail together program control panel > Default programs > set access and computer program defaults > Custom > click the caret down.

    The default e-mail program must be installed on the computer - e.g.Outlook Express, Windows Mail (Vista), Windows Live Mail, Thunderbird, etc.

    Web-based e-mail services cannot be made except by default e-mail program:
    * Yahoo, with the Yahoo tool bar
    http://help.Yahoo.com/l/us/Yahoo/mail/YAHOOMAIL/settings/settings-10.html
    * Gmail with gmail warning system installed
    http://mail.Google.com/support/bin/answer.py?answer=10966

    Hope this helps,
    Don

  • I bought the photo Illustrator and ask the Adobe site plan for individuals with credit cards, but to date I have not received the confirmation email. How can I contact for more information on the good end of the order?

    Hello 11/18/2015 I bought Illustrator photo and ask the Adobe site plan for individuals with credit cards, but to date I have not received the confirmation email. How can I contact for more information on the good end of the order?

    Your subscription to cloud shows correctly on your account page?

    If you have more than one email, you will be sure that you use the right Adobe ID?

    https://www.adobe.com/account.html for subscriptions on your page from Adobe

    .

    If Yes

    Some general information for a subscription of cloud

    Cloud programs don't use serial... numbers you, connect you to your cloud account paying to download & install & activate... you may need to sign out of the cloud and restart your computer and log into the cloud for things to work

    Sign out of your account of cloud... Restart your computer... Connect to your paid account of cloud

    -Connect using http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html

    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html

    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html

    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp

    -http://helpx.adobe.com/creative-cloud/kb/license-this-software.html

    .

    If no

    This is an open forum, Adobe support... you need Adobe personnel to help

    Adobe contact information - http://helpx.adobe.com/contact.html

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    -Select your product and what you need help with

    -Click on the blue box "still need help? Contact us. "

  • What is the best HDMI switch for use with Apple tv 4

    What is the best HDMI switch for use with Apple tv 4. I heard some do not work and the automatic switch has problems because Apple tv is still using power?

    I installed on a cutting and not because the automatic switch works because it isn't always. It came with a remote control that is almost as good, so don't mind the fact that automatic switching does not work well. The reason why I chose cutting is because it was the first device that gave me the good picture and sound quality with my AppleTV, the Xbox 360 and the PS4. (Don't ask!)

  • Any camera regardless of the interface is available for use with the LabView interface.

    Hello

    I intend to go for some CMOS camera,

    but I have a huge doubt before buying, the camera of menttioned above is not anywhere in this list. Nor can I see any type being supported USB device.

    The question is

    1. is a camera regardless of the interface is available for use with the LabView interface?
    2. Can I build a VI to communicate with any device image and recording of camera and take the data?

    Any kind of help or advice is greatly appreciated... I have to buy a CMOS camera and begin to run.

    Thank you...

    Hello Virginia,.

    I am pleased that this information has been useful, one thing I wanted to mention is that USB 3.0 has its own standard USB 3.0 Vision which is currently not supported. If this camera is also Direct Show compatible then you will be able to acquire an image using IMAQdx and manipulate all the attributes that are published to the API Live Show.

    I hope that USB 3.0 Vision will be supported in the near future, and we tentatively announced for this standard of communication for the August 2013 Vision Acquisition Softwareupdate.

    See you soon,.

    -Joel

  • I tried to send an email with attachment and without attachment and received the "windows live Hotmail was not able to complete this application. "Microsoft may contact you about problems that report you.

    I tried to send an email with attachment and without attachment and received the error "windows live Hotmail was not able to complete this application. "Microsoft may contact you about problems that report you.

    Hi AbdiNur,

    This forum is for comments on the Microsoft Answers site.  As your question is on Hotmail, I recommend posting your question on the forums for Hotmail:

    http://www.windowslivehelp.com/forums.aspx?ProductID=1

    Thank you for using Microsoft Answers!

  • Email with attached video will not leave the Outbox... Cannot delete Email with the attached video.

    Email with attached video will not leave the Outbox... Cannot delete Email with the attached video.

    Check to work offline , and then it should delete.

  • Impossible to create capture instant for VM1, error-3941 (create the snapshot has failed)

    I vSphere 4.0.0 208111 using VDR 1.1.0.707 appliance for backup of a Windows Server 2003 SP2 with VMware tools installed (including the VSS component).

    I am unable to back up a VM, but can save all other virtual machines.

    Have tried to re - install VMware tools, ensuring Windows VSS patches are up to date.

    I can do a ntbackup to system within the virtual machine with success status.

    Impossible to find someone else suffer the same error with-3491, create the snapshot has failed.

    Any ideas?

    Paul

    To simulate a VDR initiated snapshot, try a manual snapshot of the virtual machine and see if it passes or fails.  If it fails, then that explains the error 3941.  Be sure to uncheck the memory status and check the comments of quiesce file system option during an attempt of the manual snapshot because it will mimic the snapshot operation that initiates the VDR.

  • Get error redirection unless I tape/index.html for homepage

    Hi people, I get this error on my site, I have updated over the weekend:

    www.arrowmark.co.nz redirected you too many times.

    ERR_TOO_MANY_REDIRECTS

    I can load the site by typing the complete address to http://www.arrowmark.co.nz/index.html

    But if I just type in www.arrowmark.co.nz I get error redirect - obviously, this is not ideal for my potential visitors.

    Can you see what I did wrong, what has caused this new error?

    Thanks in advance for the advice,

    JO

    Maybe there is no default document set for your web server? You may need to set the file index.html is the default document.

    Jim

Maybe you are looking for

  • Satellite P100 - can I use more powerful processors?

    I have model P100-324 with Core 2 Duo T7400 2, 16GHz and wonder what more powerful CPU, I can install in my notebook. T7400 uses bus 667 MHz. As says P945 datasheet, this chipset supports 800 and 1066 bus MHz as well. So in theory, we can install mor

  • Internet connection drops every 30 minutes

    I'm chasing a frustrating problem on one of our HP laptops. The laptop loses its internet connection after 30 to 60 minutes, and the only way to get it back is to restart the PC. The PC is a dv6 Pavilion with Intel Core i5 processor chip. Operating s

  • build error - no code error - LV 2009

    I am trying to build a simple program OR Motion.  The program works fine but when I build the application I get a copy error.  The destination, it is trying to build a path access that I do not understand why he is trying to save it?  The error is at

  • DVD Player detects only not MSI Motherboard 865PE-Neo3

    Hello I just finished one of my two friends to fix computers. One is the ASUS MB (computer) and the other Mo MSI (so there is no confusion). Note: both computers are built to order. The ASUS I completely fixed and works 100%. The MSI computer isn't "

  • I'm locked as administrator on my computer, Help! I forgot my password, what now?

    I forgot my password for owner and cannot connect to anything as an administrator, please help!