Log in

View Full Version : How I can send email through Oracle 6i Forms?


sunilkjose
Aug 17, 2007, 12:19 AM
How I can send ane email through oracle 6i forms ?

whfamily2006
Oct 13, 2009, 09:59 PM
basically, create the stuff below.
create a button on the form, call send_mail..

you will need to know you mailhost

code..

tkyte@TKYTE816> 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.

tkyte@TKYTE816> begin
2 send_mail( '[email protected]',
3 '[email protected]',
4 'Hello Tom' );
5 end;
6 /

PL/SQL procedure successfully completed.

aciesler
Nov 1, 2011, 11:09 AM
I get the email, however, my ISP requires authentication and I am having difficulty figuring out how to authenticate with an SMTP server before sending the email. Help?