Hi All,
I have below a procedure in the package using UTL_MAIL.send to send email. This procedure runs fine ( send email successfully ) when executed from SQL Plus like EXEC email_jobs.send_email;
This procedure is not working when I try to run using DBMS_JOB.submit. Job is getting submitted, any code other call to UTL_MAIL.send is getting executed as well but job is not sending any email.
I cannot think of any reason.
Here is test package and calls to the procedure.
Thanks in advance.
snaseer
----------------------------------------------------------------------------------------------------------------
CREATE OR REPLACE Package email_jobs AUTHID CURRENT_USER IS
PROCEDURE send_email;
End;
/
CREATE OR REPLACE Package Body email_jobs IS
PROCEDURE send_email is
Begin
UTL_MAIL.send (
sender => 'your email',
recipients => 'my email',
subject => 'Test Subject',
message => 'Test Message....'||TO_CHAR(SYSDATE, 'DD-MON-YY HH24:MI:SS'),
mime_type => 'text; charset=us-ascii'
);
End;
-------
END;
/
----------------------------------------------------------------------------------------------------------------
directly call
exec email_jobs.send_email;
call via submit job.
declare
vJobNumber NUMBER;
Begin
sys.DBMS_JOB.submit ( JOB => vJobNumber,
WHAT => 'email_jobs.send_email;',
NEXT_DATE => SYSDATE,
INTERVAL => 'TRUNC(SYSDATE + ((1/2)/144), ''MI'')'
);
commit;
End;
/