Home » SQL & PL/SQL » SQL & PL/SQL » How to send a email through procedure
How to send a email through procedure [message #223464] Fri, 09 March 2007 00:38 Go to next message
donind
Messages: 95
Registered: February 2007
Member
Hi,

I need to write a trigger when ever the event occurs it has to send email to all recipents in list.

Any help with example really appreciated.

Thanks
Re: How to send a email through procedure [message #223470 is a reply to message #223464] Fri, 09 March 2007 01:05 Go to previous messageGo to next message
martijn
Messages: 283
Registered: December 2006
Location: Netherlands
Senior Member
google a bit for utl_smtp

I think there will also emerge some examples
Re: How to send a email through procedure [message #223505 is a reply to message #223464] Fri, 09 March 2007 04:08 Go to previous message
ddkdhar
Messages: 68
Registered: February 2007
Member

call procedure in trigger

create or replace
  2  PROCEDURE send_mail (p_sender       IN VARCHAR2,
  3                       p_recipient IN VARCHAR2,
  4                       p_message   IN VARCHAR2)
  5  as
  6     l_mailhost VARCHAR2(255) := 'aria.us.oracle.com';
  7     l_mail_conn utl_smtp.connection;
  8  BEGIN
  9     l_mail_conn := utl_smtp.open_connection(l_mailhost, 25);
 10     utl_smtp.helo(l_mail_conn, l_mailhost);
 11     utl_smtp.mail(l_mail_conn, p_sender);
 12     utl_smtp.rcpt(l_mail_conn, p_recipient);
 13     utl_smtp.open_data(l_mail_conn );
 14     utl_smtp.write_data(l_mail_conn, p_message);
 15     utl_smtp.close_data(l_mail_conn );
 16     utl_smtp.quit(l_mail_conn);
 17  end;
 18  /
Procedure created.


check this link for more
Previous Topic: Exlain Plan for Group By Clause
Next Topic: working with abstract data type, help
Goto Forum:
  


Current Time: Sat Dec 10 12:46:27 CST 2016

Total time taken to generate the page: 0.27238 seconds