Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: PL/SQL for e-mail
Hi,
For sending an email from PL/SQL in Oracle 8i you may want to look at the standard package UTL_SMTP. See it's description in Oracle8i Supplied PL/SQL Packages Reference, Release 2 (8.1.6), A76936-01.
See below for an example of its use (cited from the Reference manual). I haven't used it myself though.
Regards,
Menno
Example
The following code example illustrates how the SMTP package might be used by an application to send email. The application connects to an SMTP server at port 25 and sends a simple text message.
PROCEDURE send_mail (sender IN VARCHAR2,
recipient IN VARCHAR2, message IN VARCHAR2)IS
mailhost VARCHAR2(30) := 'mailhost.mydomain.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, sender); utl_smtp.rcpt(mail_conn, recipient); utl_smtp.data(mail_conn, message); utl_smtp.quit(mail_conn);
![]() |
![]() |