Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Function 1

Status
Not open for further replies.

CassidyHunt

IS-IT--Management
Jan 7, 2004
688
US
Does anyone have an example function that sends an email from Oracle?

accepts arguments like to, from, subject, message

then sends it.

Any help will be appreciated.

thanks

Cassidy
 


Have you tried doing a search?
[noevil]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
For the record, Oracle has had the capability of sending email from within the database server since Oracle 8i using the utl_smtp package. Carp wrote a faq, faq186-231, in the Oracle 8i forum describing how to use utl_smtp for this purpose. It looks as if the faq could use a little updating to include new features.

Starting with Oracle 10g, there is also a utl_mail package, which greatly simplifies the process of sending email from an Oracle database. To get it to work, you need to set the initialization parameter, smtp_out_server, to the correct address and port of your email server. The invocation of utl_mail is then quite straightforward. Something like the following should work:

Code:
begin
utl_mail.send(sender => 'senders email address here',
  recipients => 'list of recipients here',
  subject => 'subject line here',
  message => 'message body here');
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top