Apex 4: How to send email when form is submitted?

Hi,
Using Apex 4.0.2 on DB 11g, I've a form with around 80 fields and 4 check boxes.
When the user clicks on submit button, besides saving the values in the database I also have to send emails. Selection of the 4 check boxes decides whom the email has to go to, i.e if 2 check boxes are checked, send 2 emails.
In the emails, some contents will be based on the data the user has filled and some from the database; also data in different emails will be different.
From what I've read, to send email I've to use APEX_MAIL API and make a conditional process depending on the check boxes selected. Also that I have configure mail server in database and that mail sever has to accept autonomous user (i.e. sending email without password)
Is this the right approach?
How can I do this?
Is there any example/tutorial that will guide me in doing this?
Thank you for your time.

The Apex email package is very simple.
v_id := apex_mail.send(
          p_to        => v_to,
          p_from      => v_from,
          p_subj      => v_subject,
          p_body      => v_body,
          p_body_html => v_html);It's up to you how you get the values of the variables.
Also that I have configure mail server in database and that mail sever has to accept autonomous userThe mail server is not in the database, but you do have to inform Apex which server to use (smtp.yourcompany.com).
Most smtp servers require user and password. In that case you have to write your own procedure. Search the pl/sql forum for email authentication and you will find many examples.
It is probably also possible to configure the smtp server in such a way that requests coming from the database do not need authentication. That is how we have it configured (but I don't know how the administrator did it, though).

Similar Messages

  • Help: how to send emails from FORMS?

    Are there simple steps to send emails from FORMS?
    Thank you in advance.
    Jimmy

    I'm sure there are many ways to send emails from Forms. Personally I never had to do this, but I can imagine following ways.
    a) use UTL_SMTP-Package to send the email via your database
    b) use a Java-Call
    Peter

  • How to send emails when smtp server stops working?

    How do  i send e mails when my smtp server has stopped working?

    How can users send email messages if the Exchange Server goes offline?
    Is there a system that can be setup in case of server failure?
    Thanks in advance. 
    Check out the HA options with Exchange 2013
    https://technet.microsoft.com/en-us/library/dd638137(v=exchg.150).aspx
    High availability and site resilience
    Twitter!: Please Note: My Posts are provided “AS IS” without warranty of any kind, either expressed or implied.

  • How to send email when resubmission ends?

    Hi experts,
    In my workflow the users want to receive reminder on specific date.
    So when the step arrive to the workplace, the users make resubmission and the step transferred to RESUBMISSION folder.
    On Resubmission date I have to send email to some users.
    The Resubmission date coming must be also the terminating event for the Task.
    There actions must be performed only when Resubmission date coming
    and not if user performs "End Resubmission" manually.
    How can I do this?
    Can anyone help me?
    Thanks,
    Nina.

    Hi Nina,
       You can use dead line monitoring to solve the resubmission problem. I am explaining the scenario I used it for.
    I had to re execute the  agent resolution after a certain date is passed and there were some more conditions to be checked before that. When you activate deadline a new output option is available called "Dead Line Passed". In this output you can use process control type step for making current work item obsolete, this will give control a new output called "Processing obsolete" in this branch you can call send email step and loop back and re submit the work item to who ever you want same person. In my case it has to be next level in approval hierarchy so I just added one level and looped back to decision step for new agent resolution.
    I hope this makes sense. If you give exact scenario I may work out a prototype or simple steps.
    Warm Regards,
    Anuj Nagpal

  • How to send email using forms in cq5 to anonymoys user?

    Hello,
    I need to send mail from a popup form in CQ5.6 to anonymous users on any domains like gmail,yahoomail etc.
    I config the admin console properties of the DAY CQ Mail service.
    SMTP server details:-smtp.gmail.com
    port 465
    I create a form on a page ans define action as MAIL.After sending the mail it will redirect to the thank you page.
    My concern is when i am submitting the mail via send button it will not work.I am not getting any response in inbox of the user.
    Do anyone have idea for the same?
    Thanks in advance

    If your form is running on a box which can mail from the command line you can also do it from a host command. For example, we mail from our web forms solaris middle tier with
    HOST('echo "First line of text'||chr(10)||
    'Second Line of text " | mailx -s "Subject" Address');
    Solaris automatically sends this to our exchange server identified as mailhost in the hosts file.

  • How to send email when task is acquired by a user

    hi all again
    I need help about notifications in tasks. There are some statuses in task(assigned,outcome updated etc.) but i can't see acquired or released states. These are covered in ASSIGNED state but always same mail goes when a task is assigned to a group and acquired by a user(this confuses customer). How can i manage these? Is there a way?
    Thks

    so any help? I need a solution very urgent
    thks

  • How to sending email from Oracle Forms

    How to sending email from Oracle 6i(Forms)
    I need to send email to a distribution list(multiple email addresses).

    send email of multiple email address
    [email protected],[email protected],[email protected]
    create or replace function mailout
    (sender in varchar2,
    recipient in varchar2,
    ccrecipient in varchar2,
    subject in varchar2,
    message in varchar2) return number
    is
    crlf varchar2(2) := chr(13)||chr(10);
    connection utl_smtp.connection;
    mailhost varchar2(50) := 'Add email server Ip Address here';
    header varchar2(4000);
    v_num number :=1;
    str number:=0;
    email varchar2(50);
    begin
    connection := utl_smtp.open_connection(mailhost,25);
    header := 'Date: '||to_char(sysdate,'dd mon yy hh24:mi:ss')||crlf||
    'From: '||sender||' '||crlf||
    'Subject: '||subject||crlf||
    'To: '||recipient||crlf||
    'Cc: '||ccrecipient||crlf||message;
    utl_smtp.helo(connection,mailhost);
    utl_smtp.mail(connection,sender);
    utl_smtp.rcpt(connection,recipient);
    while (instr(ccrecipient,',',1,v_num)>0) loop
    email:=substr(ccrecipient,str+1,instr(ccrecipient,',',1,v_num)-str-1);
    dbms_output.put_line(email);
    utl_smtp.rcpt(connection,email);
    str:=instr(ccrecipient,',',1,v_num);
    v_num:=v_num+1;
    end loop;
    utl_smtp.open_data(connection);
    -- utl_smtp.write_data(connection,header);
    utl_smtp.write_data(connection,'MIME-Version:1.0'||crlf||'Content-type:text/html'||crlf||header);
    utl_smtp.close_data(connection);
    utl_smtp.quit(connection);
    return 0;
    exception
    when utl_smtp.invalid_operation then
    dbms_output.put_line('Invalid Operation in SMTP transaction');
    return 1;
    when utl_smtp.transient_error then
    dbms_output.put_line('Temporary problem with sending email ');
    return 2;
    when utl_smtp.permanent_error then
    dbms_output.put_line('Permanent problem with sending email ');
    return 3;
    end;

  • How can i send emails from forms

    I need to be able to send emails from forms 6.(assuming the pc is running Outlook) What is the best way of doing this? Would OLE or DDE control of Outlook be the easiest method?
    If anyone has done this please let me know.

    See:
    iOS: Unable to send or receive email
    I would Google for:
    setup verizon email on phone
    for the settings to use.

  • [SOLVED]How to send email to a local user?

    I have installed Mutt, msmtp, procmail and I can send and receive emails to/from remote hosts and I'd like to send email locally also (to the recipients on the same machine as the sender).
    When I try to send email to a local user from the root account -
    echo "Test message" | mail -s "Test subject" localuser
    then I get an error that connection to the port 25 is refused. Because the /etc/msmtprc file contains the 'localhost' as the default account's host, and on the local host I don't have a mail server listening on 25 port running.
    When I try to send email from a non-root account which has in /$HOME/.msmtprc file a real email account on a remote server, then of course there is an error that the domain for the email address 'localuser' is not recognized.
    How can sending email to local users be enabled?
    Last edited by nbd (2014-09-30 22:33:37)

    If I understand correctly, postfix it's a constantly running daemon. Seems to be an overhead for delivering only from time to time sent messages.
    ewaller wrote:
    > Out of the box, sendmail should be safe, but I think you have to enable local mail.
    Currently I have msmtp-mta installed, which is described as having sendmail functionality. If I install sendmail - will it be possible to send local email without running email daemons?

  • HT4979 why can I not send email when away from my home wifi? Am able to receive messages OK, and outgoing mailserver is correct?

    Why am I unable to send email when away from my home wifi ? I am able to receive mail OK, and have double- checked the outgoing server which is correct. This problem is consistent with my Macbook Pro, iPhone, and iPad2.
    Attempts to send messages results in them sitting in the Outbox and never- ending 'sending message' displayed.
    I am able to send using my   me.com  server.
    Home service provider is Cogeco.
    Any help would be appreciated.

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Try a Reset - iPad How-Tos  http://ipod.about.com/lr/ipad_how-tos/903396/1/
    Or this - Delete the account in Mail and then set it up again.
     Cheers, Tom

  • TS3899 I can't send email when wifi is on

    I can't send email when wifi is on. How do I fix??

    I can't send email when wifi is on. How do I fix??

  • Send email when error

    Hi!
    How can I send to somebody (USER) an email if during a process of a prog.
    an error occurs. Any Function Module ??
    Regards
    sas

    Hi,
    Here is the example Program to send the mail
    *& Report  ZSENDEMAIL                                                  *
    *& Example of sending external email via SAPCONNECT                    *
    REPORT  zsendemail                    .
    PARAMETERS: psubject(40) type c default  'Hello',
                p_email(40)   type c default '[email protected]' .
    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
    Regards
    Sudheer

  • How to send emails to Multiple Users from a Single People Picker lookup field using Sharepoint designer workflow

    Hi All,
    I am working with SharePoint 2013 designer workflow. we are using office 365.
    Our requirement to send email to multiple users, get the user groups from lookup list people and groups column.
    But SP designer sending emails to the first user alone.
    Please guide me to proceed.
    Advance Thanks.
    Regards
    Jenkins NS
    Thanks and Regards Jenkins

    finally I got a solution
     Identified a workaround to solve the issue using SharePoint designer.
    Step 1
    Create a lookup list Example department
    Columns
    Title (by default) – Single line of text
    Users – Person or Group
    Emails – Multiple lines of text
    hidden the Emails column (go to content type and set the column as hidden)
    Create a SharePoint designer Workflow
    Start Workflow automatically when an item is created
    Also Start Workflow automatically when an item is changed
    Workflow Stage 1
    Set Emails to current Item: Users
    The workflow will get all users email ids and add in the Emails column delimiter as semicolon.
    Step 2
    Create a custom list to get the email ids and send email
    Create a lookup column ex: analysis and refer department list, Allow multiple values
    Then Create a SharePoint designer workflow
    full details workflow steps please follow below
    URL
    http://jenkinsblogs.com/2015/04/30/how-to-send-emails-to-multiple-users-from-lookup-list-people-picker-field-using-sharepoint-designer-workflow/
    Thanks and Regards Jenkins

  • Sending emails via Forms or pl/sql

    Does anyone know how to implement UTL_SMPT for sending emails via Forms or pl/sql ?
    If not, any other suggestions for sending a newsletter-type of email to a fairly large list of people ?
    Thanks,
    Bob

    If your are using microsoft windows you can achieve this by using MAPI SESSION & MAPI MESSAGE ActiveX Control.
    These controls are not installed in windows by default, you have to install these from some cd like visual basic, visual studio etc.
    Zulqarnain

  • I run DeviceDemo sample to send email, when click send email button after f

    I run DeviceDemo sample to send email, when click send email button after filling all fields, it took me to EverNote application, can not send email. does anyone has this kind experience? how to fix it?

    Hi,
    ADF Mobile cannot directly send emails as this is a security precaution of your mobile phone (imagine all applications could send mails without you confirming). Instead the send mail functionality launches the mail client you have configured and fill in the information you provided in the application. The mail function by the way is implemented through Cordova.
    Frank

Maybe you are looking for

  • Spry Menu Appears different in IE8 and IE7

    All, As most of the people who post on this site I am new to Dreamweaver CS4.  I think I've done a pretty good job and programming my site and my skills will only get better with time.  However I am having one issue that I have wrestled with all day.

  • Acrobat 9's PDF Printer prints pages individually (W7x64)

    Hello, I have a user that tries to print a document using Acrobat 9's PDF Printer. Despite specifying to print the whole document, the printer prompts a save location for each page of the document. This is done from Excel 2010 Pro Plus with the OS Wi

  • How do I hide and unhide photos in Photos for Mac

    How do I hide and unhide photos in Photos for Mac ? Also, how do I delete an Album ? It appears that Photos is a work in progress that is only about 10% done. The Help in Photos is essentially useless. Where can I find the equivalent of a manual or i

  • Posting GR against IB, user-exit to calcluate exchange rate

    Hi guys, this is my requirement. When we do a goods receipts in VL32N (Click on post goods receipts), this will create a material document, the amounts calculated in the material document (Amount in Local Currency, mseg-DMBTR) are calculated against

  • Image should work as hyper link in smartform

    Hi, I am able to convert smartform with images in to HTML format and able to send as e-mail using the program similar to SF_XSF_DEMO_MAIL. As soon as the user receives e-mail, he should able to click on images and should redirect to other webpage. (I