DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: using sendmail inside a Procedure!

  1. #1
    Join Date
    May 2003
    Location
    Hyderabad
    Posts
    5

    using sendmail inside a Procedure!

    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.
    Amit
    Oracle DBA(OCP) v8i,v9i.

  2. #2
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142

  3. #3
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    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;
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  4. #4
    Join Date
    May 2003
    Location
    Hyderabad
    Posts
    5

    Thanks!

    I sincerely thank all of you out there for the valuable suggestions...

    Actually this was required for a developer.

    Kind regards,

    -Amit.
    Amit
    Oracle DBA(OCP) v8i,v9i.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width