Hi all,
Is there a way in oracle v9i R9.2.0.6.0 OS Sun Solaris to use sendmail or any other functionality inside a procedure..
Thank You for your time!
Regards,
Amit.
Printable View
Hi all,
Is there a way in oracle v9i R9.2.0.6.0 OS Sun Solaris to use sendmail or any other functionality inside a procedure..
Thank You for your time!
Regards,
Amit.
Do you want to be able send an email via a procedure, something like this?
Code:create or replace procedure EMAIL
is
-- Define mail defaults
v_mailhost varchar2(64) := 'hostname';
v_from varchar2(64) := 'oracle@hostname';
v_to varchar2(64);
v_mail_conn Utl_Smtp.Connection;
begin
v_mail_conn := Utl_Smtp.Open_Connection(v_mailhost, 25);
utl_smtp.helo(v_mail_conn, v_mailhost);
utl_smtp.mail(v_mail_conn, v_from);
utl_smtp.rcpt(v_mail_conn, v_to);
utl_smtp.open_data(v_mail_conn);
utl_smtp.write_data(v_mail_conn, 'From: "Oracle"' || utl_tcp.crlf);
utl_smtp.write_data(v_mail_conn, 'Subject: Test'|| utl_tcp.crlf);
utl_smtp.write_data(v_mail_conn, 'Email content here...');
utl_smtp.close_data(v_mail_conn);
utl_smtp.quit(v_mail_conn);
end EMAIL;
I sincerely thank all of you out there for the valuable suggestions...
Actually this was required for a developer.
Kind regards,
-Amit.