Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Automated Email

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #203740
    samson
    Participant

    Hi! I want to send an automated Email While any of the DML operation is fired. Can Any one sand me the code.
    please..
    Thank you.!

    #203742
    samson
    Participant

    Thank you for your advice.

    I want to send email while any of the INSERT,UPDATE or DELETE operation is performed by using triggers concept in pl/sql.
    The code I have implemented is placed below.
    Thank you!

    create or replace procedure send_mail (
    p_mail_host in varchar2,
    p_from in varchar2,
    p_to in varchar2,
    p_subject in varchar2,
    p_message in varchar2)
    as
    l_mail_conn utl_smtp.connection;
    begin
    l_mail_conn := utl_smtp.open_connection(p_mail_host, 25);
    utl_smtp.helo(l_mail_conn, p_mail_host);
    utl_smtp.mail(l_mail_conn, p_from);
    utl_smtp.rcpt(l_mail_conn, p_to);
    utl_smtp.open_data(l_mail_conn);
    utl_smtp.write_data(l_mail_conn, ‘Date: ‘ || to_char(sysdate, ‘DD-MON-YYYY HH24:MI:SS’) || Chr(13));
    utl_smtp.write_data(l_mail_conn, ‘From: ‘ || p_from || Chr(13));
    utl_smtp.write_data(l_mail_conn, ‘Subject: ‘ || p_subject || Chr(13));
    utl_smtp.write_data(l_mail_conn, ‘To: ‘ || p_to || Chr(13));
    utl_smtp.write_data(l_mail_conn, ” || Chr(13));
    utl_smtp.write_data(l_mail_conn, p_message || Chr(13));
    utl_smtp.close_data(l_mail_conn);
    utl_smtp.quit(l_mail_conn);
    end
    send_mail;

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.