Use Apex_Mail.Send From A Background Job

I am trying to use the Mail API to send Mail generated from a DBMS_Job entry. I am getting an error stating I must run this from an application to use this feature. Am I missing something or have done something wrong ? Or is this not possible from background jobs.
Any help appreciated,
Thanks,
Tom

Take a look at this thread from 2009.. I believe it will help you.. Re: How Can I Run APEX_MAIL Outside of ApEx?
Thank you,
Tony Miller
Webster, TX

Similar Messages

  • Sending an email with html tags in it using apex_mail.send

    Hello,
    I am using APEX_MAIL.SEND to send emails from my apex applications.
    now I need the email body to have html features: bold, underline, colors etc.
    If I use regular html tags, they show up in the email.
    How can this be done?
    Thanks
    Rani

    Hi, try
    p_body_html
    and it should display just fine :)

  • APEX_MAIL.SEND from a pl/sql function

    I have created a pl/sql function, in the database, in which I would like to use APEX_MAIL.SEND to send out emails.
    When I try to compile I get the following errors:
    Compilation failed,line 10 (08:44:32)
    PLS-00307: too many declarations of 'SEND' match this callCompilation failed,line 10 (08:44:32)
    PL/SQL: Statement ignored
    Here is the relavent code. Line 10 is the line where I have APEX_MAIL.SEND
    LOOP
    APEX_MAIL.SEND (
    P_TO => email_rec.TO_EMAIL,
    P_FROM => email_rec.FROM_EMAIL,
    P_BODY => email_rec.BODY,
    P_BODY_HTML => email_rec.BODY,
    P_SUBJ => email_rec.SUBJECT );
    I am in APEX version 3.0.0.00.20
    I can send mail from a APEX application procedure. The function I am having trouble with is one that can be accessed under the SQL Workshop --> Object Browser --> Functions.
    Other functions work fine.
    Thanks.

    Have a look at the following thread Re: HTMLDB_MAIL.SEND Cursor for loop
    It might be a problem of your data types you have defined in email_rec. Eg. do you have a CLOB for SUBJECT?
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

  • Send/export the background job spool in Excel (in MHTML format) in ECC 6.0.

    Hello All,
    I have a requirement to send/export the background job spool in Excel (in MHTML format) in ECC 6.0. Please help.
    Thank you.
    Nalini

    Hi Jigar,
    Thanks for your response.
    Anything is like download to desktop or email is fine. But in MHTML format.
    We can download the ALV report in MHTML spreadsheet format when we run the program online. But the program is running for long time and going to dump.
    So i scheduled it as background job and downloading the output in  .HTML format. But user wants the spool/report output in .MHTML spreadsheet format.
    I can write the code. Instead of changing the existing program I would like to know is there any way (from standard SAP) that I can get the background spool in MHTML spreadsheet format.
    Thanks,
    Nalini

  • Invalid Certificate Microsoft Outlook cannot sign or encrypt this message because you have no certificates which can be used to send from your e-mail address.

    Hi,
    I have a problem when trying to sign emails with an X.509 certificate in Outlook 2010. I constantly get the error message. The certificate is Verified for the email address I'm sending from.
    "Invalid Certificate
    Microsoft Outlook cannot sign or encrypt this message because you have no certificates which can be
    used to send from your e-mail address."I have no problem with signing documents in Word 2010 with the same certificate, only when trying to send email.Every check I can perform confirms that there's nothing wrong with the certificate. Yet, Outlook still says it is invalid.I have even tried installing a second X.509 for the same email address just to check. Outlook doesn't seem to like either certificate.I know this has been posted before, but I'm completely stuck here.Thanks,~Dan

    Hi,
    You may have checked the option "Encrypt contents and attachments for outgoing messages" in Outlook, please uncheck this to test if the problem persists.
    File -> Options -> Trust Center -> Trust Center Settings -> E-mail Security -> Clear the checkbox "Encrypt contents and attachments for outgoing messages" -> OK.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs. Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Using htmldb_mail.send from a job

    Hi , I'm trying to use the htmldb_mail.send from sqldeveloper, but I dont see it in APEX mail queue and I dont get the mails . I tried from all users (flows_020000,htmldb_public_user) without sucesses, what am I doing wrong ?
    p.s.
    i'm trying to create a job that will send email regulary .
    regards,
    sagsag

    declare
    tomail varchar2(30):='[email protected]';
    frommail varchar2(20):='[email protected]';
    text varchar2(30) :='mail from htmldb_public_user';
    begin
    htmldb_mail.send(
    p_to => tomail,
    p_from => frommail ,
    p_body => text,
    p_subj => text);
    end;

  • Passing data from a background job to RFC calls in different App server

    The program i am working on can be explained in the following steps:
    Step A- We use a standard program that is executed as a background job and the standard program obtains some data for a particular scenario.
    Step B - The job(standard program) during its execution creates many RFCs executed as dialog work processes on various application servers and processes data.In the RFCs various exits are executed.
    We currently write data to database(Z table) in Step A and retreive data in exits in Step B to access the information written to DB(Z table). We want to eliminate writing to database since it consumes time.
    Is there any solution apart from writing data to database and retreiving the same.
    I am not sure if we can use ABAP memory or SAP memory to access the information in the exits since they are executed on different App servers.

    We have not been able to arrive at a solution to the below, any solutions / inputs will be rewarded.

  • Send Attachment via background job

    Hi,
    Is there any function module/program  in SAP where we can send attachment to external parties via scheduled background job?
    Thank you.

    Dear YEO WEI KOK,
    Please check the following link: 
    http://www.sap-img.com/abap/sending-mail-with-attachment-report-in-background.htm
    Hope this helps you.
    Do award points if you found them useful.
    Regards,
    Rakesh

  • Can I use the CL_GUI_FRONTEND_SERVICES class in background jobs

    can i use the class CL_GUI_FRONTEND_SERVICES and its methods for the background job purposes...
    Thankyou
    Bhaskar

    Hi Bhaskar,
    normaly it doesn't work in background,
    But there is one solution shown by Srilatha Thirukkovalluri.
    Here the link:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2
    Hope it helps.
    Regards, Dieter

  • HT1689 if i have only iPhone, can I use iMessage send from iPhone to iPhone?

    hi!
    i would like to know if i have only iPhone. Can i use iMessage send free message to others iPhone?

    hello
    thank you. i just can do now the reason my friend not setting yet. thank you. :)

  • ?my apple account used an email from a previous job that i can't access now

    My apple account was my ex work email I no longer have access to I thought i had changed it but when I try and update apps my user name still comes up with the old one and won;t let me chane it help please ?

    As Linc has said, those purchases are tied to your 'work' Apple ID.
    If you could proivde more information, maybe we can help.
    So you don't have access to the email address associated with the Apple ID, but do you have your AppleID  assword?  Are you unable to update the purchases in the App Store?  Did you forget the AppleID password at some point, and now you can not recover it?  If so, have you tried using the security questions to recover your account?
    Is this account tied to purchasing/billing for your former employeer, or is it a personal account that you happened to use your work email for?
    If you can access your account, have you tried the steps in this article?
    http://support.apple.com/kb/ht5621
    Apple ID is a little more flexible now in terms of renaming and using alternate email addresses, that is, if you can access the account.

  • Starting Background Job from program...

    Hello I am using following to create a background job.
      DATA: number TYPE tbtcjob-jobcount,
            name TYPE tbtcjob-jobname VALUE 'METZ: INVOICING FROM SHIPMENT',
            print_parameters TYPE pri_params.
      data vari  LIKE varid-variant.
      data shipm    LIKE vttk-tknum.
      data use  LIKE   btch2170-username.
      vari = '3350_1' .
      shipm = p_shipment.
      use = 'K5_BATCH'.
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobname          = name
        IMPORTING
          jobcount         = number
        EXCEPTIONS
          cant_create_job  = 1
          invalid_job_data = 2
          jobname_missing  = 3
          OTHERS           = 4.
      IF sy-subrc = 0.
        SUBMIT Z5L_START_INVOICING with p_shipm = shipm
                                   with p_vari = vari
                                   with p_submit = 'X'
                                   USER use VIA JOB name NUMBER number
                                   and return.
        IF sy-subrc = 0.
          CALL FUNCTION 'JOB_CLOSE'
            EXPORTING
              jobcount             = number
              jobname              = name
              strtimmed            = 'X'
            EXCEPTIONS
              cant_start_immediate = 1
              invalid_startdate    = 2
              jobname_missing      = 3
              job_close_failed     = 4
              job_nosteps          = 5
              job_notex            = 6
              lock_failed          = 7
              OTHERS               = 8.
          IF sy-subrc <> 0.
          ENDIF.
        ENDIF.
      ENDIF.
    I am using the addition USER but the job gets started with user who is log on or who is using this trasaction.
    It should start with user 'K5_BATCH' but it is not...........
    Please help........
    Edited by: Alvaro Tejada Galindo on Apr 7, 2008 1:00 PM

    I found the following info:
    Open Job Scheduling Without Dialog (Including COMMIT WORK)
    Use JOB_OPEN to create a background job.  The function module returns the unique ID number which, together with the job name, is required for identifying the job.
    Once you have "opened" a job, you can add job steps to it with JOB_SUBMIT and submit the job for processing with JOB_CLOSE.
    I think you will first have to use the JOB_SUBMIT  statement like mentioned above

  • Regarding Background Job Abort using

    Hi ,
    I am using FM BP_JOB_ABORT to abort background jobs through program,but it taking longtime to cancel background jobs in SM37 after exectuing FM BP_JOB_ABORT in program..
    will i have to write  any statement in program after this  FM BP_JOB_ABORT to cancel the background job immediately through program..
    Awaiting for valuable suggestion..
    Regards
    Anil

    Hi,
    I looking for FM to cancel background jobs quikly through program..
    Regards
    Anil

  • How to identify what are all the events are created in background jobs?

    Hi all,
    how to identify what are all the events are created for  background jobs. And what events gets triggered for a particular job.
    thanxs
    haritha

    Hi Haritha,
    JOB is a program which starts to a determined point of time and executes some standard programs in the system. JOBs can be planed to a determined point of time on the regular basis (every night, for example) or to some discret time moments. So, the JOB can be planed and then will be started automatically without the manual start.
    Realtime programs are understood in the most cases as actual program execution which is started by somebody to the actual moment of time.
    Typically per JOBs some special processes will be started that should be executed automatically and regularly: for example, IDOC application, some correction reports, statistic updates etc.
    Standard jobs are those background jobs that should be run regularly in a production SAP System These jobs are usually jobs that clean up parts of the system, such as by deleting old spool requests.
    Use
    As of Release 4.6C, the Job Definition transaction ( sm36 ) provides a list of important standard jobs, which you can schedule, monitor, and edit.
    Standard jobs are those background jobs that should be run regularly in a production SAP System. These jobs are usually jobs that clean up parts of the system, such as by deleting old spool requests.
    for more information you can go thru the following thread:
    http://help.sap.com/saphelp_nw70/helpdata/en/24/b884388b81ea55e10000009b38f842/frameset.htm
    About Events:
    Events have meaning only in the background processing system. You can use events only to start background jobs.
    Triggering an event notifies the background processing system that a named condition has been reached. The background processing system reacts by starting any jobs that were waiting for the event.
    Types of Events:
    There are two types of events:
    1.)System events are defined by SAP. These events are triggered automatically when such system changes as the activation of a new operation mode take place.
    2.)User events are events that you define yourself. You must trigger these events yourself from ABAP or from external programs. You could, for example, signal the arrival of external data to be read into the SAP system by using an external program to trigger a background processing event.The event scheduler processes an event if the event is defined in the system.
    For example, if a system (System 1) receives an event from another system (System 2), the event scheduler of System 1 processes the event only if it is defined in System 1. That event does not need to be defined in System 2 (the sending system).
    You define an event by assigning a name (EVENTID) to it. When defining an event, you do not define the event arguments.
    for more information you can go thru the following thread:
    http://help.sap.com/saphelp_nw04s/helpdata/en/fa/096e2a543b11d1898e0000e8322d00/frameset.htm
    When you schedule the process chain or infopackages the jobs associated with it run in the background mode. In case you want to create a job for a specific activity you can do so in SM36. You would be creating jobs that would get executed in any one of the options:
    1. Immediate
    2. Date & Time
    3. After event.
    4. After job.
    5. At Operation mode.
    In case you want to view the job logs go to sm37.
    Also Pls check DB02 for database performance and ST03 for workload .
    Analyse u will have an idea ,
    *pls assign points,if info is useful**
    Regards
    CSM reddy
    null

  • Create Background jobs

    How can i create background jobs and link them to the Event so that they will be triggered? I have no clue on this, can anyone explain in a detailed manner with the Transaction codes for each.
    Thanks in advance.

    Hi laitha,
    JOB is a program which starts to a determined point of time and executes some standard programs in the system. JOBs can be planed to a determined point of time on the regular basis (every night, for example) or to some discret time moments. So, the JOB can be planed and then will be started automatically without the manual start.
    Realtime programs are understood in the most cases as actual program execution which is started by somebody to the actual moment of time.
    Typically per JOBs some special processes will be started that should be executed automatically and regularly: for example, IDOC application, some correction reports, statistic updates etc.
    Standard jobs are those background jobs that should be run regularly in a production SAP System These jobs are usually jobs that clean up parts of the system, such as by deleting old spool requests.
    Use
    As of Release 4.6C, the Job Definition transaction ( sm36 ) provides a list of important standard jobs, which you can schedule, monitor, and edit.
    Standard jobs are those background jobs that should be run regularly in a production SAP System. These jobs are usually jobs that clean up parts of the system, such as by deleting old spool requests.
    for more information you can go thru the following thread:
    http://help.sap.com/saphelp_nw70/helpdata/en/24/b884388b81ea55e10000009b38f842/frameset.htm
    About Events:
    Events have meaning only in the background processing system. You can use events only to start background jobs.
    Triggering an event notifies the background processing system that a named condition has been reached. The background processing system reacts by starting any jobs that were waiting for the event.
    Types of Events:
    There are two types of events:
    1.)System events are defined by SAP. These events are triggered automatically when such system changes as the activation of a new operation mode take place.
    2.)User events are events that you define yourself. You must trigger these events yourself from ABAP or from external programs. You could, for example, signal the arrival of external data to be read into the SAP system by using an external program to trigger a background processing event.The event scheduler processes an event if the event is defined in the system.
    For example, if a system (System 1) receives an event from another system (System 2), the event scheduler of System 1 processes the event only if it is defined in System 1. That event does not need to be defined in System 2 (the sending system).
    You define an event by assigning a name (EVENTID) to it. When defining an event, you do not define the event arguments.
    for more information you can go thru the following thread:
    http://help.sap.com/saphelp_nw04s/helpdata/en/fa/096e2a543b11d1898e0000e8322d00/frameset.htm
    When you schedule the process chain or infopackages the jobs associated with it run in the background mode. In case you want to create a job for a specific activity you can do so in SM36. You would be creating jobs that would get executed in any one of the options:
    1. Immediate
    2. Date & Time
    3. After event.
    4. After job.
    5. At Operation mode.
    In case you want to view the job logs go to sm37.
    _List of Background Jobs_
    BIREQU - Load of a Request/Reconstruction of a request
    BI_AGGR4 - Aggregates activation
    BI_BTCH - Any batch job like ABAP program run in background
    BI_DELR - Deletion of request
    BI_HIER - Hierarchy loading/activation
    BI_ODSA - ODS activation
    BI_PROCESS_ABAP - ABAP program in process chain
    BI_PROCESS_LOADING - Data Loading in process chain using nfopackage
    BI_PROCESS_ODSACTIVAT - ODS actiavation in Process chain
    BI_PROCESS_TRIGGER - Trigger job for process chain
    BI_PSAD - probably PSA deletion
    BI_STAT - Building statistics
    BI_STRU - Change run job
    BI_WRITE_PROT_TO_APPLLOG - Application log job
    RANATL_ACCT_CACHE_WARMUP
    Use tcode SM62 to create User events.
    Use tcode SM64 to trigger the event.
    Wizards for Event Creation :pls chk this link
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/f7/d1c20a02d511d3a6550060087a79ea/frameset.htm
    *pls assign points,if info is useful**
    Regards
    CSM reddy

Maybe you are looking for

  • IDOC Monitoring returns wrong result

    Hi All I set up IDOC Monitoring to generate Yellow alert when No. of IDOC is less than 6 and ref when it is more than 6. However, even when the no. of IDOC is more than 6, I get a Yellow alert. I checked "Auto Notif" under Notifications and Service D

  • Webutil client/server

    Hello, I am using webutil in a server, and the clients use it to extract some data to a csv. The problem is that the created files are inserted in the server side, and I would like to save them in the client side. Actually it uses the path I select i

  • Flex 2 RSS

    Hello, im building a website for a company that would like the use of RSS feeds in a flex app. However, I created the flex app perfectly fine, and it works on my computer. But when I upload it to my webserver and run it, the flex loads, but the RSS d

  • How  to  copy one IDoc type

    Hi guys! I need to copy one idoc type with Z extension to another R/3 system. How to do it? Thank you! Olian

  • Engineering student wanting a macbook pro! HELP!!!

    Ok, so my heart has been set on a macbook pro for a WHILE now. But lately a lot of people have scared me into shock and are making me think twice about buying it... I am a computer engineering student at the University of Florida. I have yet to use a