Forum Stats

  • 3,853,750 Users
  • 2,264,264 Discussions
  • 7,905,440 Comments

Discussions

DBMS_SCHEDULER and email

Mr Neil
Mr Neil Member Posts: 113 Blue Ribbon
edited Jan 21, 2016 1:24PM in APEX Discussions

I'm a bit confused with the Scheduler and email.

I have a Procedure that sends an email, just a simple one for testing purposes. This procedure runs and works fine.

I can set up a Schedule to run the above mentioned procedure and it fails. I know the scheduler works because I can change the procedure code to (for example) update a field in a table and this is successful.

I think my problem lies with the EMAIL_SERVER and EMAIL_SENDER attributes of the scheduler.

I don't understand how the procedure can send email successfully from and SQL window, or a APEX page, but it can't do it from being scheduled.

Also, I'm not sure what the effect is if I set the scheduler attributes (EMAIL_SERVER and EMAIL_SENDER). Will this affect only emails sent by the scheduler? (ie, will I break anything)

Oracle 11.2

Application Express 4.2.6.00.03

I'm not dba. I am workspace owner.

Thanks,

NT

Tagged:

Best Answer

Answers

  • Mahmoud_Rabie
    Mahmoud_Rabie Cloud Solution Architect, Member Posts: 3,216 Bronze Crown
    edited Jan 20, 2016 10:37PM Answer ✓

    Hi Mr Neils

    I hope this thread solves your problem

    Regards

    Mahmoud

  • Pavel_p
    Pavel_p Member Posts: 2,314 Gold Trophy
    edited Jan 21, 2016 11:13AM

    Hi NT,

    <code>how does your procedure look like (I mean what package do you call)? Do you use APEX_MAIL, UTL_MAIL, UTL_SMTP or UTL_TCP? Did you send mail successfully from SQL window in SQL workshop or SQLDeveloper...or any other SQL window? What error are you getting? You should be a "bit" more specific.

    Regards,

    Pavel

  • Steve Maxwell
    Steve Maxwell Member Posts: 40 Blue Ribbon
    edited Jan 21, 2016 1:24PM

    Hello, The scheduler email settings will not affect your procedure since you can have it working standalone. The scheduler email settings are for scheduler notifications which is completely different than what you are explaining. Most likely problem is that you are using APEX_MAIL in your procedure. This will not work when the procedure is running as a job. If you change your procedure to use UTL_MAIL or UTL_SMTP then it will continue to work when scheduled.

This discussion has been closed.