Home » Developer & Programmer » Forms » How to use the host command to send mail in Forms 6i through PLSQL
How to use the host command to send mail in Forms 6i through PLSQL [message #41193] Mon, 09 December 2002 13:01 Go to next message
Terry Sicard
Messages: 1
Registered: December 2002
Junior Member
If at all possible, I need an example on how to send mail through forms 6i without opening the mail utility??

Thanks
Re: How to use the host command to send mail in Forms 6i through PLSQL [message #41194 is a reply to message #41193] Mon, 09 December 2002 13:41 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
I beleive there are many methods.
1. you integrate forms with outlook.
2. use ORA_JAVA package.
3. use utl_smtp (oracle server side).
4. use a sendmail or mailx ( from forms, call this OS command) etc etc
Re: How to use the host command to send mail in Forms 6i through PLSQL [message #348300 is a reply to message #41194] Tue, 16 September 2008 06:46 Go to previous messageGo to next message
gauravgg
Messages: 4
Registered: September 2008
Location: Bangalore,India
Junior Member
how to integrate forms with outlook for sending mails with some msges?
Re: How to use the host command to send mail in Forms 6i through PLSQL [message #348312 is a reply to message #348300] Tue, 16 September 2008 07:01 Go to previous message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

This is a procedure i use

PROCEDURE send_email
   ( sendernm   IN  VARCHAR2,
     senderid   IN  VARCHAR2,
     recipient  IN  VARCHAR2,
     subject    IN  VARCHAR2,
     message    IN  LONG,
     mailsrvr   IN  VARCHAR2)
IS
     host       VARCHAR2(30) := mailsrvr;
     mail_conn  utl_smtp.connection;
     crlf       VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
     msg        long;
     TMP_DATE   DATE;
BEGIN 
	 
     mail_conn := utl_smtp.open_connection(host, 25);
     select sysdate into tmp_date from dual;
     msg:= 'Date: ' || TO_CHAR(TMP_DATE-3/24,'dd Mon yy HH24:MI:SS')|| crlf ||
     'From: '||sendernm||'<' ||senderid||'>' || crlf ||
     'Subject: '||subject || crlf ||
     'To: '||recipient || crlf ||
     '' || crlf || message;
     utl_smtp.helo(mail_conn, host);
     utl_smtp.mail(mail_conn, senderid);
     utl_smtp.rcpt(mail_conn, recipient); 
     utl_smtp.data(mail_conn, msg);
     utl_smtp.quit(mail_conn);
Exception
     When others then
     Null;
END;
Previous Topic: Getting program name in PL/SQL
Next Topic: Manually Generating number
Goto Forum:
  


Current Time: Sat Dec 10 08:47:58 CST 2016

Total time taken to generate the page: 0.10741 seconds