Sign Up

Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In


Have an account? Sign In Now

Sign In

Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Sorry, you do not have permission to add post.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Oraask Logo Oraask Logo
Sign InSign Up

Oraask

  • Write
    • Add A New Post
    • Ask A Question

Oraask Navigation

Search
Ask A Question

Mobile menu

Close
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Dev Tools
    • Online Compiler
    • Base64 Converter
  • Wiki
    • SQL Tutorials
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials
Home/ Questions/Q 3817
Next
In Process

Oraask Latest Questions

Question
oracle user
  • 0
  • 0
oracle userExplorer
Asked: June 21, 20162016-06-21T21:41:07+03:00 2016-06-21T21:41:07+03:00In: PL/SQL

How to Send e-mail from PL/SQL ?

  • 0
  • 0

please I want to know how can I send emails from PL/SQL I heard about there is a package called UTL_MAIL but I want some examples to do this
thanks in advance

oraclepl/sqlsend mailUTL_MAIL
1
  • 1 1 Answer
  • 3k Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    Related Questions

    • Export query result to Oracle Server
    • What is the difference between Implicit and Explicit Cursor in Oracle
    • How many triggers can I create on a single table in Oracle Database
    • How many types of collections are there in Oracle
    • Can we extend Varray in Oracle PL/SQL

    1 Answer

    • Voted
    • Oldest
    • Recent
    1. Hassan AbdElrahman
      Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
      2016-06-21T22:07:52+03:00Added an answer on June 21, 2016 at 10:07 pm

      hi there,

      starting from oracle 8i we are eligible to send emails directly from PL/SQL by using either UTL_SMTP or UTL_TCP packages. However, oracle provides us valuable package called UTL_MAIL for sending emails in Oracle 10g.

      here is example of how to use UTL_MAIL to send emails from PL/SQL :

      BEGIN
        EXECUTE IMMEDIATE 'ALTER SESSION SET smtp_out_server = ''127.0.0.1''';
        UTL_MAIL.send(sender => 'me@address.com',
                  recipients => 'you@address.com',
                     subject => 'Test Mail',
                     message => 'Hello World',
                   mime_type => 'text; charset=us-ascii');
      END;

      Note : for security purpose, UTL_MAIL is not enabled by default. so you should enable it by connecting to SYS user and executing the utlmail.sql and prvtmail.plb scripts in the $ORACLE_HOME/RDBMS/admin directory. In addition, you must configure an initialization parameter, SMTP_OUT_SERVER, to point to an outgoing SMTP server.
      in addition, you must give EXECUTE permission to PUBLIC by run below script :

      grant execute on UTL_MAIL to public

      hope this helpful 🙂
      share with others to stretch our experiences

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    Sidebar

    Adv 250x250

    Explore

    • Categories
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Dev Tools
      • Online Compiler
      • Base64 Converter
    • Wiki
      • SQL Tutorials
      • Java Tutorials
      • Python Tutorials
      • JavaScript Tutorials

    Footer

    Oraask

    About

    Oraask is a website for developers and software engineers who want to learn new skills, share their knowledge, and solve their coding problems. Oraask provides free content on various programming languages and topics, such as Oracle, Python, Java, etc. Oraask also allows users to ask questions and get answers from other members of the community.

    About Us

    • About Us
    • Contact Us

    Legal Stuff

    • Privacy Policy
    • Terms & Conditions

    Follow

    Oraask is licensed under CC BY-NC-SA 4.0Oraask CopyrightOraask CopyrightOraask CopyrightOraask Copyright

    © 2019 Oraask. All Rights Reserved
    With Love by Oraask.

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.