title: How Can I Send Emails in PL/SQL (Oracle)?
body: <p>I have a procedure which count the number of rows in SMS_OUTBOX table and send emails if its row cont is over 1000. My procedure is given below:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE SEND_EMAIL_ABOUT_PENDING_SMS IS
    CHECK_SMS_COUNT NUMBER := 1000;
    CURRENT_SMS_COUNT NUMBER;
  BEGIN
    SELECT COUNT(1) INTO CURRENT_SMS_COUNT FROM SMS_SCHEMA.SMS_OUTBOX;
  
    IF CURRENT_SMS_COUNT &gt;= CHECK_SMS_COUNT THEN
      UTL_MAIL.SEND(
          sender=&gt;'&lt;SENDER_EMAIL&gt;',
          recipients=&gt;'&lt;RECIPIENT_EMAIL&gt;',
          subject=&gt;'Pending SMS',
          Message=&gt;'Pending SMS count exceeded.'
      );
    END IF;
  END SEND_EMAIL_ABOUT_PENDING_SMS;
  /
  </code></pre>
  
  <p>When I compile the above I got this error.</p>
  
  <p><a href="https://i.stack.imgur.com/8Fgyl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8Fgyl.png" alt="enter image description here"></a></p>
  
  <p>Then I tried this line of code to execute without the procedure:</p>
  
  <pre><code>EXEC UTL_MAIL.SEND(
      sender=&gt;'&lt;SENDER_EMAIL&gt;',
      recipients=&gt;'&lt;RECIPIENT_EMAIL&gt;',
      subject=&gt;'Pending SMS',
      Message=&gt;'Pending SMS count exceeded.'
  );
  </code></pre>
  
  <p>Then I got this error:</p>
  
  <p><strong>PLS-00302: component 'SEND' must be declared</strong></p>
  
  <p>I am very new to Oracle (and PL/SQL). Can anyone please help me on sending emails in Oracle and what are the configurations needed?</p>