Code to Send Email from Oracle DB

Code to Send Email from Oracle DB



DECLARE
v_connection UTL_SMTP.CONNECTION;
BEGIN
v_connection := UTL_SMTP.OPEN_CONNECTION(’mail.company.com’,25);
UTL_SMTP.HELO(v_connection,’mail.company.com’);
UTL_SMTP.MAIL(v_connection,’contact@company.com’);
UTL_SMTP.RCPT(v_connection,’contact@company.com’);
UTL_SMTP.DATA(v_connection,’Testing Hello Mail’);
UTL_SMTP.QUIT(v_connection);
END;

admin posted at 2009-1-15 Category: PeopleCode Tips | Tags: ,

One Response Leave a comment

  1. #1John @ 2009-1-21 09:11

    Its interesting code to write for sending email. I tried and was able to send mail. In what cases, you will use this code? Any ideas..

Leave a Reply

(Ctrl + Enter)