Oracle - Send mail with UTL_SMTP

Procedure PL/SQL to send a email using UTL_SMTP package:

Declare
  l_mail_conn   UTL_SMTP.connection;
BEGIN
  l_mail_conn := UTL_SMTP.open_connection('', 25);
  UTL_SMTP.helo(l_mail_conn, '
');
  UTL_SMTP.mail(l_mail_conn, '');
  UTL_SMTP.rcpt(l_mail_conn, '  UTL_SMTP.data(l_mail_conn, '' || UTL_TCP.crlf || UTL_TCP.crlf);
  UTL_SMTP.quit(l_mail_conn);
END;

Comments

Popular posts from this blog

Hibernate - HibernateException: createQuery is not valid without active transaction