Home » Developer & Programmer » Forms » Email from forms
Email from forms [message #80298] Wed, 04 September 2002 11:09 Go to next message
Eric Bender
Messages: 9
Registered: June 2002
Junior Member
Hi, was just wondering if anyone has ever seen or written any code to email through forms. As in if I have a field that contains an email address, what I would need to do in a trigger to export the email address to outlook or an exchange server. Thanks!

Eric
Re: Email from forms [message #80299 is a reply to message #80298] Wed, 04 September 2002 12:20 Go to previous message
Julie Toft
Messages: 9
Registered: August 2002
Junior Member
Try this:

PROCEDURE send_mail ( sender IN VARCHAR2,
recipient IN VARCHAR2,
subject IN VARCHAR2,
message IN VARCHAR2,
err OUT VARCHAR)
IS
mailhost VARCHAR2(30) := '192.156.999.1';
-- IP address of mail server
mail_conn utl_smtp.connection;
crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
mesg VARCHAR2( 1000 );
BEGIN
mail_conn := utl_smtp.open_connection(mailhost, 25);
mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf||
'From: <'||sender||'>' || crlf ||
'Subject: '||subject || crlf ||
'To: '||recipient || crlf ||'' || crlf || message;

utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, sender);
utl_smtp.rcpt(mail_conn, recipient);
utl_smtp.data(mail_conn, mesg);
utl_smtp.quit(mail_conn);

Exception
WHEN OTHERS THEN
err := SQLERRM;
END;
Previous Topic: Re: Oracle Forms 6i Runtime
Next Topic: ***Contditional EXIT before running Report***
Goto Forum:
  


Current Time: Thu Apr 25 01:42:38 CDT 2024