Sending MAIL on particular date in APEX 4.1

Hello all,
I want send mail automatically on the basis of a date column in my table. whenever that date is the current date of the system a mail should be sent to user?
Please help me with this.

Hello Pankaj,
My approach will be as follows:
<ul><li>
Create a procedure to notify all the users whose say account expiry date matches system date i.e. sysdate
procedure send_notification
as
begin
for rec in (select EMP_ID, EMP_MAIL from EMP where ACCT_EXP_DT = SYSDATE)
loop
     //call procedure to send mail to notify the expiry date
end loop;
end;</li><li>
Now, schedule the above procedure to run every day at say 06:00 PM with the help of DBMS_SCHEDULER
begin
-- create a schedule
-- daily from Monday to Sunday at 18:00 (06:00 p.m.) 
dbms_scheduler.create_schedule (
schedule_name    => 'INTERVAL_DAILY_1800', 
start_date       => trunc(sysdate)+18/24, 
repeat_interval  => 'FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI,SAT,SUN; BYHOUR=18;', 
comments         => 'Runtime: Every day (Mon-Sun) at 18:00 o''clock');
-- Call the procedure to send mail 
dbms_scheduler.create_program (
program_name    => 'PROG_NOTIFY_ACCNT_EXP', 
program_type    => 'STORED_PROCEDURE', 
program_action  => 'SEND_NOTIFICATION', 
enabled         => true, 
comments        => 'Procedure to notify account expiry' );
-- Connect both dbms_scheduler parts by creating the final job 
dbms_scheduler.create_job (
job_name       => 'JOB_NOTIFY_ACCNT_EXP', 
program_name   => 'PROG_NOTIFY_ACCNT_EXP', 
schedule_name  => 'INTERVAL_DAILY_1800', 
enabled        => true, 
auto_drop      => false, 
comments       => 'Job to notify account expiry');
end;</li></ul>
If you are planning to use [url http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_mail.htm#CIHDIEJI]APEX_MAIL package to send mail and if you are using packaged procedure to send mail then take following in consideration:
{message:id=10145867}
Hope it helps!
Regards,
Kiran

Similar Messages

  • Sending mail to multiple mailid from apex

    Hi,
    I need to send mail to multiple users from apex which is taken from a database table column. Is it possible to use LOV to send mail to multiple mail id? I tried with using collection but unable to reach it.
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
    p_collection_name => List_of_mailid,
    p_query => select column from table where cond='Y');
    any ideas.... thanks in advance.

    What you need to do is, build a string with the multiple e-mail addresses, and then when you want to send mail See this oldie but goodie thread:
    Have mutiple email addresses in Apex Email functionality
    Thank you,
    Tony Miller
    Dallas, TX

  • Steps to send mail after insertion in Oracle APEX

    Hi
    I am working on one application in which i want to send mail to a user after every insertion.
    Edited by: Pankaj Kumar on Feb 2, 2012 3:57 AM

    Pankaj Kumar wrote:
    Hi
    I am working on one application in which i want to send mail to a user after every insertion.
    Edited by: Pankaj Kumar on Feb 2, 2012 3:57 AMHi,
    See APEX_MAIL API document
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_mail.htm#CIHDIEJI
    Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0

  • Sending mail automatically on date

    Hi,
    I am new to JavaMail. I am having a doubt that is there any method in JAVA that automatically send the mail on a particular day. For e-x, if i set the sentDate as tomorrow, it has to send the mail on tomorrow itself, not the day, when i composed the mail.i.e., composing the mail today and sending it later.

    No, there's no special method to do precisely that. And this question really has nothing to do with JavaMail. If you want a program that does something at a particular time, there are many ways of doing that. Most operating systems have a task scheduler that let you run jobs at specified times or frequencies, and there's a Timer class in Java if you need to code it yourself.

  • Send mail on specific date and time

    Does anyone know how can I tell Mail to send a mail on a specific date and time?

    Mail won't do it by itself, but iCal will. Create an event at the specific date and time you want the mail sent. You will then need to create a simple applescript to send the desired email content to the desired recipient. Then instruct iCal to 'run script' at the desired time.
    Check out the applescript forum here on Apple Discussions for help with the applescript.
    It will be a FUN learning experience!

  • Sending Mail after saving data in QA11

    Hi all,
    In QA11 my user will change or enter some quantity( to unrestricted use field )  in Inspection lot stock tab.
    Whenever they change or eneter  the quantity a mai(internal sap mail)l should be generated with the details of lot number,material code and quantity what they entered.
    How I can achieve this...
    Plz help me regarding this issue..
    Thanks in advance....
    Regards,
    Murthy.

    Hi ,
    Thanks for quick reply.
    I tried it, but its not triggering..
    I tried the following userexits also..QEVA0004,QEVA0005,QEVA0006,QEVA0007,QEVA0008,QEVA0009,QLCO0001,QSS10001.
    Could you tell me and BADI'a are there for this tcode QA11.
    thanks & regards,
    Murthy.
    Edited by: kan murthy on Sep 17, 2009 12:29 PM

  • Sending mail to a particular positon in org structure via workflow

    hi all
    i have a problem regarding sending mail to particular position in org structure on runtime execution  via workflow so that i neednt hard court the particular position
    to achieve this i am using expressions,first i have created a new container element and then i have used container operation like this:
    (lead.employee responsible.business partner= container element defined by me)
    when i first try to execute the workflow and test it ,in the container  i am getting the value of the container element in which i have the position where i have to send the mail.but inspite of value getting populated ,when i am using that container element to send mail like:
    expression: container element
    the mail is not send,when i checked the log it is mentioned that " you are not the authorised person to stsart the workflow and start failed" but workflow is still triggered and i am able to pass the object but not able to send the mail.
    please tell me is there any feasible way to achieve this,like rule or in my way how is it able to achieve
    detailed possible solution will really be appreciated.on thing we are working on CRM 5.0 standalone system
    full marks will be rewarded
    best regards
    ashish

    Hi,
    Follow this ,
    Goto PFTC -> Choose "Workflow Template" from the drop down -> Enter the workflow template id "123********" in the text box -> now click on "change" button -> Now goto the menu addional data -> agent assignment -> maintain -> select the task text -> and set it as general task.
    I guess you have done the same for the standard task TS*********** but failed to do it for the workflow template (WS123*************). Or have you done it already?
    Also once you make this change "Refresh your buffers" once before checking it out.
    Richard A

  • Convert sap script to pdf and send mail before close_form

    hi experts,
    I am converting a sap script to PDF and then sending that pdf to vendor mail ids.
    I am getting the Data for the conversion of pdf From close_form.But it contains the data for all the vendors . But i have to Send the mail to the specific vendors.For ex if my script output has 5 sheets each with different vendors . I have to send  1 sheet as a pdf mail for that particular vendor. so,1 sheet each for 5 differrent vendors . But the data i get from close_form is the data for all the 5 vendors. How to split the data ?. can any one help me on this issue.
    with thanks in advance,
    syed

    Hi,
        Change your driver program so that it calls the script n no of times .. and every time send mail to particular vendor ..
        Loop at vendors.
         call the form ...
         send mail ...
        endloop ...
    Regards,
    Srini.

  • Function to send mail

    Hi friends,
    can u help me out in solving my problem.
    I want to send mail to particular email address with some contents in the body of the mail, which function to use?

    REPORT ZNNR_EMAIL.
    PARAMETERS: psubject(40) type c default 'Hello',
    p_email(40) type c..
    data: it_packing_list like sopcklsti1 occurs 0 with header line,
    it_contents like solisti1 occurs 0 with header line,
    it_receivers like somlreci1 occurs 0 with header line,
    it_attachment like solisti1 occurs 0 with header line,
    gd_cnt type i,
    gd_sent_all(1) type c,
    gd_doc_data like sodocchgi1,
    gd_error type sy-subrc.
    data: it_message type standard table of SOLISTI1 initial size 0
    with header line.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    Perform populate_message_table.
    *Send email message, although is not sent from SAP until mail send
    *program has been executed(rsconn01)
    PERFORM send_email_message.
    *Instructs mail send program for SAPCONNECT to send email(rsconn01)
    perform initiate_mail_execute_program.
    *& Form POPULATE_MESSAGE_TABLE
    Adds text to email text table
    form populate_message_table.
    Append 'Email line 1' to it_message.
    Append 'Email line 2' to it_message.
    Append 'Email line 3' to it_message.
    Append 'Email line 4' to it_message.
    endform. " POPULATE_MESSAGE_TABLE
    *& Form SEND_EMAIL_MESSAGE
    Send email message
    form send_email_message.
    Fill the document data.
    gd_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
    gd_doc_data-obj_langu = sy-langu.
    gd_doc_data-obj_name = 'SAPRPT'.
    gd_doc_data-obj_descr = psubject.
    gd_doc_data-sensitivty = 'F'.
    Describe the body of the message
    clear it_packing_list.
    refresh it_packing_list.
    it_packing_list-transf_bin = space.
    it_packing_list-head_start = 1.
    it_packing_list-head_num = 0.
    it_packing_list-body_start = 1.
    describe table it_message lines it_packing_list-body_num.
    it_packing_list-doc_type = 'RAW'.
    append it_packing_list.
    Add the recipients email address
    clear it_receivers.
    refresh it_receivers.
    it_receivers-receiver = p_email.
    it_receivers-rec_type = 'U'.
    it_receivers-com_type = 'INT'.
    it_receivers-notif_del = 'X'.
    it_receivers-notif_ndel = 'X'.
    append it_receivers.
    Call the FM to post the message to SAPMAIL
    call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    exporting
    document_data = gd_doc_data
    put_in_outbox = 'X'
    importing
    sent_to_all = gd_sent_all
    tables
    packing_list = it_packing_list
    contents_txt = it_message
    receivers = it_receivers
    exceptions
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    others = 8.
    Store function module return code
    gd_error = sy-subrc.
    Get it_receivers return code
    loop at it_receivers.
    endloop.
    endform. " SEND_EMAIL_MESSAGE
    *& Form INITIATE_MAIL_EXECUTE_PROGRAM
    Instructs mail send program for SAPCONNECT to send email.
    form initiate_mail_execute_program.
    wait up to 2 seconds.
    if gd_error eq 0.
    submit rsconn01 with mode = 'INT'
    with output = 'X'
    and return.
    endif.
    endform. " INITIATE_MAIL_EXECUTE_PROGRAM
    You can use following FM's
    call function to send email
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
    document_data = docdata
    document_type = 'RAW'
    commit_work = 'X'
    TABLES
    object_header = t_objhead
    object_content = t_objtxt
    receivers = t_receiver
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    OTHERS = 8.
    also if you want to attach any file with the mail u can use following FM
    Sending the document
    IF NOT l_t_reclist[] IS INITIAL.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
    document_data = l_doc_chng
    commit_work = 'X'
    TABLES
    packing_list = l_t_objpack
    object_header = l_t_objhead
    contents_bin = l_t_objbin
    contents_txt = l_t_objtxt
    receivers = l_t_reclist
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    operation_no_authorization = 4
    OTHERS = 99.
    ENDIF.

  • How to send a mail on a particular date

    hello everybody.
    i am developing a greeting site.
    where in i need to send a mail on a particular date, which is greater than today. how can i send mail on a pre selected date.
    my server is IIS and i am using java servlets and java mail api.
    please tell me if anybody having the solution.
    or please mail me to [email protected]
    thank you
    sambareddy
    hyderabad

    As far as I know there is no method in JavaMail for sending a message on a particular date.
    However you can use the Java.util.Timer and java.util.TimerTask class to do this.
    In the class that you send your message from
    public class SendMessage extends TimerTask{
    public void run(){
    //send message here
    TimerTask implements Runnable so a thread can be created here.
    To call the thread:
    public class CallMessage{
    public static void mail(String args[]){
    SendMessage sm = new SendMessage();
    Timer timer = new Timer();
    timer.schedule(sm, 10000, 10000)
    //wait for 10 seconds and repeat in 10 seconds
    There are a number of different schedule methods available for whatever you need to do.
    Hope this helps!

  • How to send  Mail from APEX 4.1?

    Dear all,
    In APEX 4.1,
    I have a form based on the Leave_table,
    it has 5 fields,
    If the user filled all the fields and if the user clicks the APPLY/SUBMIT button the Data will be stored into the LEAVE_table ,
    Is this Possible to send the mail with the data entered as a report to a particular (manager)mail_id?
    and also the mail to contain two link/button to REJECT or APPROVE the leave applied ?
    Can anyone give me the solution?
    Thank you.
    Regards,
    Gurujothi.

    [APEX_MAIL|http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_mail.htm]

  • Need to send mail using apex

    Hi,
    I am using apex 4.2 and oracle 11g XE. I need to send mail so I used the following code:
    HTMLDB_MAIL.SEND(
          P_TO       =>  '[email protected]',
          P_FROM     =>   [email protected]
          P_SUBJ     =>  'Data in TECHNICAL_DETAIL edited' ,
          P_BODY     =>  'Please click link below for affirmation/rejection of changes' ,
          P_BODY_HTML=>   '<p><a href="http://localhost:8080/apex/f?p=109:25:12079147455079">link</a></p>'
    It is going t apex_mail_queue successfully. Then I used the following code:
    which one i should use:
    1.
         wwv_flow_mail.push_queue(
            P_SMTP_HOSTNAME => xxx
            P_SMTP_PORTNO => 'yyy
    or
    2.
         APEX_MAIL.PUSH_QUEUE(
            P_SMTP_HOSTNAME => xxx
            P_SMTP_PORTNO => yyy
    Also what else I need to send mail and what should i  ask DBA to provide me so that mail can be sent successfully.
    Please give some idea.
    Thanks,
    Chandra Bhanu

    Hi,
    You should use APEX_MAIL.PUSH_QUEUE witch is documented
    APEX_MAIL
    Parameters
    Description
    p_smtp_hostname
    SMTP gateway host name
    p_smtp_portno
    SMTP gateway port number
    Note that these parameter values are provided for backward compatibility, but their respective values are ignored. The SMTP gateway hostname and SMTP gateway port number are exclusively derived from values entered on the Manage Environment Settings when sending email.
    Regards,
    Jari

  • Workflow to send mail 20 day before the expiry date

    Dear All,
    I created a workflow to send mail when a calculated column date is equal to today as follows:-
    Step1
    add -20 days  to Current Item:Expiry Date (Output to Variable : date)
    then set variable : Notification1 to Variable : date
    Step2
    If variable:notification1 equals (ignoring time) Today
    email users
    Now when i add a new item to the list , the workflow status is set to In progress , and when i refresh the page the status is changed to Completed before the condition is met and!!
    Any help
    Regards

    If I Understood your question correctly, you need to send email to user 20 days before expiration date. 
    From above you workflow I can see, you are just checking your condition once a item is created. As your Step2 condition is not met your  workflow is completed without any error. I suggest you might want to try below workflow
    Step1
    add -20 days  to Current Item:Expiry Date (Output to Variable : date)
    then set variable : Notification1 to Variable : date
    then Pause until Variable:date
    Step2
    email users
    Above workflow design will pause you workflow till 20 days before expiry date. and then send email to user. 
    Please ignore syntax, I just tried to put logic.
    Below is explantion on how to use Pause Action(from MSDN) in Sharepoint workflow
    This action is initially displayed in a workflow step as Pause until this time.
    Use this action to pause the workflow until a particular date. You can add a current date, a specific date, or a lookup.
    Following are examples of what the action might look like in a workflow step,
    Pause until 1/1/2010 12:00:00 AM
    Pause until Variable: A week from Modified
    If this helps Please mark it answer or vote as helpful.
    Thanks
    Siddharth

  • Not Able to Send Mail in Oracle Apex

    Hello Apex Experts,
      I am using Amazon Cloud  with details as using Oracle Apex 4.1 and Oracle 11g as database using Glass Fish Server.
    Problem am facing is E-Mail are not working. I tried adding our company smtp address but still it is not working.
    In Oracle Apex Admin scree Under Manage Instance --> Instance Settings --> Email tryed adding ( localhost and 10.1.1.100 SMT address ) this didnt work
    I am using below code to send mail 
    Begin
    -- Send plain text email
      APEX_MAIL.SEND(
        P_TO       =>  '[email protected]',
        P_FROM     =>  '[email protected]',
        P_CC       =>  '[email protected]',
        P_BCC      =>  '[email protected]',
        P_SUBJ     => 'test',
        P_BODY     => 'test');
       apex_mail.push_queue('10.1.1.100', 25);
    End;
    SELECT * FROM APEX_MAIL_QUEUE;
    I get ORA-24247: network access denied by access control list (ACL) . I also see last_updated as SYS in the log
    Please suggest me how to fix this issue.
    Thanks
    Sudhir

    Hi Mike,
      Thanks for your reply, Let me give you a detail on where we are stuck on send mail.
       We have a Schema called PORTAL
      We are able to send mail from UTL_SMTP as mentioned below in a procedure
    create or replace PROCEDURE send_mail (p_to        IN VARCHAR2,
                                           p_from      IN VARCHAR2,
                                           p_message   IN VARCHAR2,
                                           p_smtp_host IN VARCHAR2,
                                           p_smtp_port IN NUMBER DEFAULT 25)
    AS
      l_mail_conn   UTL_SMTP.connection;
    BEGIN
      l_mail_conn := UTL_SMTP.open_connection(p_smtp_host, p_smtp_port);
      UTL_SMTP.helo(l_mail_conn, p_smtp_host);
      UTL_SMTP.mail(l_mail_conn, p_from);
      UTL_SMTP.rcpt(l_mail_conn, p_to);
      UTL_SMTP.data(l_mail_conn, p_message || UTL_TCP.crlf || UTL_TCP.crlf);
      UTL_SMTP.quit(l_mail_conn);
    END;
    Begin
    send_mail('[email protected]','[email protected]','test','10.0.0.100','25');
    End;
    The above code works i am able to send and receive mails.
    We also create ACL as mentioned below
    begin
    dbms_network_acl_admin.create_acl (
    acl => 'http_permission.xml', -- or any other name
    description => 'HTTP Access',
    principal => 'APEX_040100', -- the user name trying to access the network resource
    is_grant => TRUE,
    privilege => 'connect',
    start_date => null,
    end_date => null
    end;
    commit;
    SELECT * FROM dba_network_acl_privileges where principal='APEX_040100';
    begin
    DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl => 'http_permission.xml',
    principal => 'APEX_040100',
    is_grant => true,
    privilege => 'connect');
    end;
    commit;
    begin
    DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl => 'http_permission.xml',
    principal => 'APEX_040100',
    is_grant => true,
    privilege => 'resolve');
    end;
    commit;
    BEGIN
    dbms_network_acl_admin.assign_acl (
    acl => 'http_permission.xml',
    host => '10.1.1.100', /*can be computer name or IP , wildcards are accepted as well for example - '*.us.oracle.com'*/
    lower_port => 80,
    upper_port => 80
    END;
    But still we are getting same ACL Error Please suggest US
    ORA-24247: network access denied by access control list (ACL)
    Thanks
    Sudhir

  • Sending Mails Using APEX 4.2

    Hi All
    I am in need to send emails using APEX 4.2. I have seen under page processing there is option called Send Email. But really not sure how to make use of it. My requirement is to trigger a mail on employee's birthday. Following is the screenshot.
    Can anyone help me on this. Any reply would highly be appreciable.
    Process Type
    Process Attributes
    Process
    Messages
    Process Conditions
    Create Page Process - Process Type
    Cancel 
    Next
    Page:
    3 - Edit AR Employees
    Select the category of the process you wish to create:
    Select the category of the process you wish to create:
    PL/SQL
    Reset Pagination
    Plug-ins
    Session State
    Data Manipulation
    Web Services
    Form Pagination
    Send E-Mail
    Close popup window
    Run On Demand Process

    Hello,
    First you need to write a procedure to send e-mails. Please find sample code below to send e-mail to manager, if employee birthday is today
    CREATE OR REPLACE PROCEDURE pr_send_birthday_alerts
    IS
    BEGIN
      /* if V_APP_USER is null, procedure is being executed as job
      set security context */
      IF v('APP_USER') IS NULL THEN
      wwv_flow_api.set_security_group_id;
      END IF;
      -- Trigger mails if employee birthday is today
      -- Send mail to Manager email address
      /* Please change with actual table and column values */
      FOR i IN (SELECT emp.name emp_name, manager.email manager_email, manager.name manager_name FROM t_employee emp, t_employee manager WHERE emp.manager_id = manager.emp_id AND TRUNC(emp.birth_date) = TRUNC(SYSDATE))
      LOOP
      /* Send mail */
      /* Please change Subject and Body according to your need */
      APEX_MAIL.SEND(
      p_to        => i.manager_email,
      p_cc => NULL,
      p_from      => '[email protected]',
      p_subj      => 'Today is '||i.emp_name||' birthday',
      p_body      => NULL
      END LOOP;
      -- push all emails from queue
      APEX_MAIL.PUSH_QUEUE;
    END pr_send_birthday_alerts;
    Next you need to schedule a job which will run above procedure everyday to Send Birthday alerts. Please find sample code below to schedule a procedure to run as Job.
    BEGIN
      /* Change Start date according to your requirement */
      DBMS_SCHEDULER.CREATE_SCHEDULE (
      schedule_name          => 'sch_every_day',
      start_date             => TO_TIMESTAMP_TZ(TO_CHAR(SYSDATE,'YYYY-MM-DD')||' 06:00:00 +02:00','YYYY-MM-DD HH:MI:SS TZH:TZM'),
      repeat_interval        => 'FREQ=DAILY;'
      DBMS_SCHEDULER.CREATE_JOB (
      job_name                => 'job_every_day',
      schedule_name           => 'sch_every_day',
      job_type                => 'STORED_PROCEDURE',
      job_action              => 'pr_send_birthday_alerts',
      enabled                 => TRUE
      COMMIT;
    END;
    So everyday in morning 6:00 A.M. GMT+ 2, system will check if any employee birthday is today and will send alert to his/her manager.
    Please note that these code is not tested.
    Regards,
    Hari

Maybe you are looking for

  • How to reinitialize an external hard disk drive which serves for Time Machine?

    How to reinitialize an external hard disk drive which serves for Time Machine? Thanks for your answer.

  • RVL200 won't auto-reconnect to Internet after power loss (PPPoE)

    My RVL200 firmware 1.1.7 is configured for PPPoE. The connection to the Internet is via an ATT (SBC) DSL line using a Siemens Slipstream 4100 modem. The 4100 is configured to allow the PPPoE connection to be managed by the router. The RVL200's PPPoE

  • Preview slow & Adjust Size greyed out

    Preview has started running slow and I can't adjust the size of a jpeg file - Adjust Size is greyed out. I'm running OS10.9.1 on a MacBook Air.  Never had this before.  Any ideas please?

  • Photoshop CS4 Enable OpenGL

    I have just installed Photoshop CS4 Extended and am looking to enable the OpenGL Drawing function but it is greyed out. I have Dell Precision t5400 with Quad core Xeon E5410, 2gb RAM, Club 3D 8800GTS 640mb RAM graphics card on XP Service pack 2. I ju

  • Where has Alt V gone in Itunes 12

    When manually entering track- and artistinfo I often used Alt V to proceed to next track. Why has it vanished in I-tunes12? Why have Album Artist and artist fields been put on separate tabs? It is a bit of a nuisance to have to go to  different tabs