How to send a predefined email after clicking on an Insert button in a Form?

Hi,
I created my form ( three fields) where I enter a three values.
I want an email be sent every time new values are entered and the insert button clicked.
Do you know a way on how to do it please?
Thanks
Khaled.

Hi,
I do not know of a way within Portal to automatically send an email, but the database has a utility (utl_smtp) that will allow you to do so very easily. You can use Portal to insert your data and then put a trigger on your table that fires after the data is inserted that calls a procedure that will send the mail.
Here is an example of a procedure that I have used to send mail (you can get all of the info on utl_smtp in the Oracle docs). I have a Portal form that allows the user to input three values and once they click 'insert' and the data goes into the table, I have a trigger that fires 'after insert' and runs this procedure:
PROCEDURE send_register_mail (sender in varchar2,
email varchar2,
date_of_class date)
IS
mailhost VARCHAR2(30) := 'my.mailserver.com';
mail_conn utl_smtp.connection;
BEGIN
mail_conn := utl_smtp.open_connection(mailhost, 25);
utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, email);
utl_smtp.rcpt(mail_conn, '[email protected]');
utl_smtp.open_data(mail_conn);
utl_smtp.write_data(mail_conn, 'Subject: Platform Training registration request'||utl_tcp.crlf||'Content-Type:text/html;'||utl_tcp.crlf||utl_tcp.crlf);
utl_smtp.write_data(mail_conn, sender||' would like to attend the POC training scheduled for '|| date_of_class);
utl_smtp.close_data(mail_conn);
utl_smtp.quit(mail_conn);
EXCEPTION
WHEN OTHERS THEN
-- Handle the error
htp.p('There was an error processing your registration. Please contact the site administrator');
END;
Hope this helps.
-melissa

Similar Messages

  • How to send a predefined email

    Hello,
    I'm trying to send a predefined email which contains the subject and the body text in my bsp/abap application but it doesn't work. <i><b>Does anyone could help me, please?</b></i>
    I have this error message :
    <b>Exception  CX_SY_DYN_CALL_PARAM_MISSING</b>
    <b>Method</b> : OninputProcessing
    <u>This is my abap source code in my OninputProcessing</u> :
    data : adress_mail type AD_SMTPADR.
      adresse_mail = '[email protected]'.
      data msg(200) VALUE 'Data stored :'.
      data : subject type SO_OBJ_DES.
      data : subj type SOLI.
          subject = 'New event - Please check'.
          concatenate msg subj into subject separated by
    space.
    * Add data at the end of the mail
        if not ( strlen( subj ) = 0 ).
          append subj to texttab.
        endif.
    * Send email
        CALL FUNCTION 'Z_YX_SEND_SMTP'
          exporting
            I_SAV_SMTP_RECEIVER  = adress_mail
            I_SAV_SUBJECT        = subject
          exceptions
            when others = 1.
        if sy-subrc <> 0.
          error_code = 'SEND-001'.
        endif.
    endif.

    Hi,
    You don't specify what's in your 'Z_YX_SEND_SMTP'
    Check things like http://help.sap.com/saphelp_nw70/helpdata/en/58/97c43af280463ee10000000a114084/frameset.htm
    and
    /people/eddy.declercq/blog/2006/04/03/unknown-thus-unloved
    Eddy
    PS. Reward useful answers and earn points yourself

  • How to send timer job email to "assigned to" feild value in a task list?

    Hi All,
    How to send timer job email  to "assigned to" field value in a task list if due date is after two days from now?

    Create a SharePoint Designer Workflow and use "pause until date" option when an new item is created/update.
    Using Server Object model, I believe you can create the timer job from item event receiver.
    --Cheers

  • How to send photos as email attachments???

    This is a ridiculously easy and simple question but I'm a mac newbie and can't figure out how to send photos as email attachments, not embed them in the body of the email. Every time I go to send a picture or group of pictures from i-photo an email message opens....the pictures are embedded in the body of the email and that's how they appear to receipients. In a test, I've sent them to a PC...the message comes through just fine but the photos don't have separate attachments that I can click on and "save as." they come through as bitmap files. Any ideas? THANK YOU.

    It will not ALWAYS fix the problem that this topic is about; I had my Mail preferences set to send as Plain Text and it did not fix the problem. Additionally, since there is NOT an option in Iphoto as you previously noted, it might be confusing to some people.
    However, for those of you who have the same problem, there seems to be a solution that worked for me. I also had the problem that Mail was overriding my sizing preference when I selected them in Iphoto (share > email) and always sending them as small instead of medium as I preferred.
    Since it seems that sometimes Mail does not deploy the plain text default so you need to kick start it to remember. This is how I did it....
    - Select the photos you want and hit SHARE > EMAIL in Iphoto
    - Now, in Mail click on the photo browser button
    - Find another photo in Iphoto via the browser and drag and drop it into the email that you're composing
    - You'll see a size option appear in the bottom right hand corner
    - Playing around with the sizing option a few times kicked it into gear and it seems to be working better since then
    I hope that helps anyone who has had the same problem.

  • HT5312 how to send the rescue email

    i cant figure out how to send the rescue email.

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then go to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address - if it doesn't show then you don't have a rescue email address.
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then see if this user tip helps : https://discussions.apple.com/docs/DOC-4551
    e.g. you can try contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then try Apple ID Account Security
    or try ringing Apple in your country and ask to talk to the Accounts Security Team : http://support.apple.com/kb/HE57

  • How to send a sms email with a 5310

    I am trying to figure out how to send a Sms Email with my new 5310 xpress music it only allows me to enter numbers in the to box

    i would guess that you are trying to write the message possibly in the field designed for a contact name or phone number that you would like to send it to, if you go down to the rest of the lines you will be able to type your message. this is just a guess but it sounds like this might be the issue. if not please elaborate so we can assist you better. 
    You know what I love about you the most, the fact that you are not me ! In love with technology and all that it can offer. Join me in discovery....

  • TS3276 how to send a group email with iPhone 5

    how to send a group email with iPhone 5

    I have a new OSX 27" iMac that is running Maverick. 
    RE: group emails, I am trying to omit individual recients and have tried the following options without success.
    1) Mail- Composing- checked "Automatically- Bcc"
    2) Mail- Composing- unchecked "when sending to a group, show all member addresses"
    The result is that all names continue to show up with email addresses for group emails.
    HELP!  HELP!  HELP!
    Lynn 

  • How to send an group email with text and photo with  out having google trash it

    how to send a group email with imac 21.5   8.1 Yosemite gmail    without having it trashed automatically

    Check the settings on the machine(s) that are trashing it.

  • About how to send ALV through email

    Hi  everyone ,
          I have a problem about how to send ALV through email  in background . if someone knows , pls tell me .
    thanks in advance
    Best Regard
    Nick

    I write a test program , but it doesn't work , use any exists ALV program in the system , and use the "sendlist " program to send the email.  what I want is when I restrict some conditons in the selection-screen , then it send ALV to Email .
    Thanks
    Nick

  • HT3455 I got two receipts from the same tv show I bought. How's that even possible? I clicked the 'buy season ' button the first time and there was an error so I clicked it again, and now, I apparently paid for it twice!  Apple is such a rip-off!

    I got two receipts from the same tv show I bought. How's that even possible? I clicked the 'buy season ' button the first time and there was an error so I clicked it again, and now, I apparently paid for it twice!  Apple is such a rip-off!

    Wow.
    Over react much?
    Check your purchase history.  See if it actually charged you twice.
    If it did then contact itunes support for a refund.
    No need be so over dramatic.

  • How many times do you have to click the sleep/wake button to get the light brighter? (on iPod touch)

    How many times do you have to click the sleep/wake button (top button) to get the light/screen brighter? (on iPod touch)

    That is not haow you change brigntness. Go to Settings>Brightness to adjust screen brightness.

  • How to send an automated email notification after dataloads complete.

    Please search the forums before posting
    Hi ,
    Hoq can we send an automated email notification once the daily data loads are complete.
    All the data loads are done through PC and after these got complete daily we need to send an automated e mail saying the loads are completed.
    Request your replies.
    Edited by: Arun Varadarajan on Mar 10, 2009 9:22 AM

    Hi,
    check this threads/links:
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/9bdd42cadf2878e10000000a155106/frameset.htm
    Process chains and Email alerts?
    process chain Email Notification
    E-mailing functionality on a process chain
    If you search SDN you will find much more...
    Regards
    Andreas

  • How to send as an email the spool request?

    Dear Experts,
    My last post was Email background schedule report to gmail or yahoo mail .
    I got solution but it's work as a notification which we can say the after report run it triggers mail that report is completed as this time.
    But i required the thing how to send a spool request of a report  as an email attachment.
    it will be in .xls or .pdf or xyz format.
    It was the additional task which was required by my organization.
    I also want to know the following things.
    1. what is sap default configuration and system behind it.
    2. what the things abaper have to check.
    3. what is bcs_examples & where do i found these bcs_example8.
    Please guide me to explore my knowledge.
    Thanks & regards
    Nayan Lad
    Note for moderator : Sir, I will close request at 2:30 pm today onward, so please do not lock it.
    Moderator Message: All your questions can be answered by searching.
    Edited by: kishan P on Nov 13, 2010 3:29 PM

    need solution..

  • Forbid sending window to front after clicking on it.

    I have application with main window in AIR which is maximized on whole screen and a few "small" windows which are created from Window component (Window was the only option 'cause times to time I need move it out of main application) and live above main app window.
    I would like to have main app window always in the back and all other "small" windows in front of it. The problem is that whenever I click on main window system brings it to the front. So the question is how can I force AIR not to bring newly focused window to the front? I tried to set alwaysInFront=true on each "small" window (Window.NativeWindow.alwaysInFront) which worked but in the end it brought other problems and I didn't really liked the fact that they were always above all other application windows.
    I know that I could use NativeWindow.orderToFront() method and after clicking on main app window send it behind all others but all sent windows into front then blink. Perfect would be to suppress default behaviour and don't let system bring clicked window to front.
    Any idea?
    //pyso

    See if any of these provide pointers.
    *Various causes of sleep issues in Macs*
    [Post by Dale Weisshaar|http://discussions.apple.com/message.jspa?messageID=8980488] - general post on sleep issues.
    [Logitech keyboard drivers out of date after updates|http://discussions.apple.com/message.jspa?messageID=8999415]
    [Try safe boot, then rebooting normally|http://discussions.apple.com/thread.jspa?threadID=1906841]
    [Mac OS X: Why your Mac might not sleep or stay in sleep mode|http://support.apple.com/kb/HT1776]
    [A long list of sleep issue reports and comments|http://www.macintouch.com/readerreports/macosx10_4tiger/topic3083.html ]
    Check if third party USB devices or cards are causing problems.

  • How to send a confirmation email to users in dw cs6?

    Hi all,
    I am very new to dreamweaver cs6.
    I would like to ask how do i send a confirmation email to users when they have finished inputting their details in the registration page. (is it using php scripting?)
    In layman terms, the users have keyed in all their information for registration, how do I send a confirmation email to the emails they keyed? Thank you!

    You build an auto-reply message so when the information is submitted to your email address via the website form the  sender receives a confirmation.
    // build your auto reply
        $reply = $_POST['email'];
        $replysubject = "Auto-Reply: Your Website Name";
        $replyfrom = "From: [email protected]\r\n";
        $replymessage .= "Your enquiry has been successfully sent. Thank you.\r\n\r\n";
        $replymessage .= "Yours Sincerely,\r\n";
        $replymessage .= "Your Name - Position in Company\r\n";
        $replymessage .= "[email protected]\r\n";
        $replymessage .= "http://www.yourDomainName.co.uk\r\n\r\n";
        $replymessage .= "This e-mail is automated, so please DO NOT reply.\r\n";
    Then add the line below after the 'mail' funtion in the php form processing script
    mail($reply, $replysubject, $replymessage, $replyfrom);

Maybe you are looking for