Home » Developer & Programmer » Forms » How to send emeil from form 6i? (Form 6i)
How to send emeil from form 6i? [message #656184] Tue, 27 September 2016 07:39 Go to next message
usman8990
Messages: 6
Registered: May 2016
Location: Pakistan
Junior Member
I have a table which we create to give task to employees ....
Create table Business (emp_id number(10),emp_name varchar2(25),Deal_Date Date,Given_Date Date,Target_Date Date,Com_Date date,Naration varchar2(20),Catagory varchar2(25),Quality varchar2(20),emp_email varchar2(40),Deal number(20),paide number(10));

The target is when we press on the save button the data should be save and also send to Employees via email address which we will save into the column "EMp_Email" ...

please Create a procedure or Function to solve this problem
Re: How to send emeil from form 6i? [message #656187 is a reply to message #656184] Tue, 27 September 2016 07:52 Go to previous messageGo to next message
Littlefoot
Messages: 21802
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'd create a stored procedure (with appropriate parametets) which would use UTL_MAIL or UTL_SMTP to send mails.
Re: How to send emeil from form 6i? [message #656189 is a reply to message #656187] Tue, 27 September 2016 10:46 Go to previous messageGo to next message
usman8990
Messages: 6
Registered: May 2016
Location: Pakistan
Junior Member
Thanks for your Reply sir actually i am demanding full script to handle this because i dont have experience with UTL_MAIL or UTL_SMTP .

Thanks And Regards
Usman Anwar
Re: How to send emeil from form 6i? [message #656190 is a reply to message #656189] Tue, 27 September 2016 10:52 Go to previous messageGo to next message
John Watson
Messages: 8917
Registered: January 2010
Location: Global Village
Senior Member
Coime on, man! Look at utl_mail, it isn't exactly difficult:
orclz>  desc utl_mail
PROCEDURE SEND
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 SENDER                         VARCHAR2                IN
 RECIPIENTS                     VARCHAR2                IN
 CC                             VARCHAR2                IN     DEFAULT
 BCC                            VARCHAR2                IN     DEFAULT
 SUBJECT                        VARCHAR2                IN     DEFAULT
 MESSAGE                        VARCHAR2                IN     DEFAULT
 MIME_TYPE                      VARCHAR2                IN     DEFAULT
 PRIORITY                       BINARY_INTEGER          IN     DEFAULT
 REPLYTO                        VARCHAR2                IN     DEFAULT
PROCEDURE SEND_ATTACH_RAW
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 SENDER                         VARCHAR2                IN
 RECIPIENTS                     VARCHAR2                IN
 CC                             VARCHAR2                IN     DEFAULT
 BCC                            VARCHAR2                IN     DEFAULT
 SUBJECT                        VARCHAR2                IN     DEFAULT
 MESSAGE                        VARCHAR2                IN     DEFAULT
 MIME_TYPE                      VARCHAR2                IN     DEFAULT
 PRIORITY                       BINARY_INTEGER          IN     DEFAULT
 ATTACHMENT                     RAW                     IN
 ATT_INLINE                     BOOLEAN                 IN     DEFAULT
 ATT_MIME_TYPE                  VARCHAR2                IN     DEFAULT
 ATT_FILENAME                   VARCHAR2                IN     DEFAULT
 REPLYTO                        VARCHAR2                IN     DEFAULT
PROCEDURE SEND_ATTACH_VARCHAR2
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 SENDER                         VARCHAR2                IN
 RECIPIENTS                     VARCHAR2                IN
 CC                             VARCHAR2                IN     DEFAULT
 BCC                            VARCHAR2                IN     DEFAULT
 SUBJECT                        VARCHAR2                IN     DEFAULT
 MESSAGE                        VARCHAR2                IN     DEFAULT
 MIME_TYPE                      VARCHAR2                IN     DEFAULT
 PRIORITY                       BINARY_INTEGER          IN     DEFAULT
 ATTACHMENT                     VARCHAR2                IN
 ATT_INLINE                     BOOLEAN                 IN     DEFAULT
 ATT_MIME_TYPE                  VARCHAR2                IN     DEFAULT
 ATT_FILENAME                   VARCHAR2                IN     DEFAULT
 REPLYTO                        VARCHAR2                IN     DEFAULT

orclz>
It is well dedscribed in the docs, too. Just have a go.
Re: How to send emeil from form 6i? [message #656191 is a reply to message #656190] Tue, 27 September 2016 11:14 Go to previous messageGo to next message
usman8990
Messages: 6
Registered: May 2016
Location: Pakistan
Junior Member
Hy Thanks Sir For Reply ... actualy i am doing this first time so please just one time guide me with query .. also guide me is there need a database setting?
Re: How to send emeil from form 6i? [message #656192 is a reply to message #656190] Tue, 27 September 2016 11:50 Go to previous messageGo to next message
usman8990
Messages: 6
Registered: May 2016
Location: Pakistan
Junior Member
I think first i have to create a report with max Sr_No column which is Primary key .....

then i have to run this query

BEGIN
UTL_MAIL.send_attach_varchar2(sender => :p_from,
recipients => :p_to,
subject => 'Test msg',
attachment => 'Test text 1' || UTL_TCP.crlf || 'Test text 2',
att_inline => FALSE,
att_filename => 'test.PDF'
);
END;


i think first i have to do database setting for UTL_MAIL ... please help me in this

Re: How to send emeil from form 6i? [message #656193 is a reply to message #656192] Tue, 27 September 2016 12:44 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
You need to learn how to Read The Fine Manual on your own

http://docs.oracle.com/database/121/ARPLS/u_mail.htm#ARPLS384
Re: How to send emeil from form 6i? [message #656197 is a reply to message #656192] Wed, 28 September 2016 01:51 Go to previous message
John Watson
Messages: 8917
Registered: January 2010
Location: Global Village
Senior Member
What happens when you run your code? It doesn't work for me:
orclz>
orclz> var p_from varchar2(30)
orclz> var p_to varchar2(30)
orclz>
orclz> BEGIN
  2  UTL_MAIL.send_attach_varchar2(sender => :p_from,
  3  recipients => :p_to,
  4  subject => 'Test msg',
  5  attachment => 'Test text 1' || UTL_TCP.crlf || 'Test text 2',
  6  att_inline => FALSE,
  7  att_filename => 'test.PDF'
  8  );
  9  END;
 10  /
BEGIN
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.UTL_MAIL", line 662
ORA-06512: at "SYS.UTL_MAIL", line 713
ORA-06512: at line 2


orclz>
When you post code, please enclose it within [code] tags, as described here How to use [code] tags and make your code easier to read
Previous Topic: ORA-24813: cannot send or receive an unsupported LOB.
Next Topic: Unable to install Oracle Forms and Reports 12c
Goto Forum:
  


Current Time: Mon Mar 04 13:05:33 CST 2024