Forum Stats

  • 3,854,609 Users
  • 2,264,391 Discussions


sending mail through clicking a button

636287 Member Posts: 67
edited Nov 12, 2008 1:03PM in Forms
I am using oracle developer suite 10g and oracle database 10g.
the problem is like this , I have a table named emp which has two columns
employee_id number primary key,
and last_name varchar2(20) ;
I have two text boxes names :block3.text_item8 and :block3.text_item9 , and a push button named push_button4;
when I click on the button the data inside the text_boxes will be saved in the emp table as declared and also a mail will be sent to an email address which will be provided through another text_item :block3.text_item10 in the format say [email protected] .
I can save the data after clicking the button through simple dml queries , but I am not able to send the auto genearted mail which will send a message to that e-mail address that an entry with this mail account has been made .

could you please help me with a step by step procedure to do this.
Thanx for your interest .


  • Alok Dubey
    Alok Dubey Member Posts: 358
    Hi Sourav,
    What is the code u r using to send the mail. In general utl_smtp is used to send the mail. For further information u can search in this forum, where in we've many examples. If u've written any code then do display the code. so that any one of us can help you.

    Alok Dubey
  • Hafed Benteftifa
    Hafed Benteftifa Member Posts: 167 Green Ribbon

    There are several options for sending email.

    1) Write a stored procedure using utl_smtp or utl_mail (new with 10g). This is the easiest to implement. See for example:
    Problems you can have here: your smtp server does not allow you to send email or won't relay emails from your side. Most problems I have seen with this implementation were related to the smtp server.

    2) Use the javamail PJC/javabean from the Oracle PJC demos. This one is a bit easier to implement but does require some preliminary setup. You might have to check the smtp server again and make sure it can relay your emails.

    Hope this helps.
  • Andreas Weiden
    Andreas Weiden Member Posts: 10,871 Gold Crown
    a third option is to use OLE (or CLIENT_OLE in 9i, 10g) and send the mail via outlook.
This discussion has been closed.