How to send a mail using utl_mail

Dear Experts
i am facing problem while using the utl_mail package. whatever steps i have follow is underwritten.
have a look.......
SQL> ALTER SYSTEM SET SMTP_OUT_SERVER='smtp.gmail.com' SCOPE=SPFILE;
System altered.
SQL> @?/rdbms/admin/utlmail.sql
Package created.
Synonym created.
SQL> @?/rdbms/admin/prvtmail.plb
Package body created.
No errors.
SQL> BEGIN
2 UTL_MAIL.SEND(SENDER => '[email protected]',recipients => '[email protected]',message => 'all is well', subject =>'wishes 4 u');
3 END;
4 /
BEGIN
ERROR at line 1:
ORA-29279: SMTP permanent error: 530 5.7.0 Must issue a STARTTLS command first.
39sm1824546yxd.6
ORA-06512: at "SYS.UTL_SMTP", line 21
ORA-06512: at "SYS.UTL_SMTP", line 99
ORA-06512: at "SYS.UTL_SMTP", line 222
ORA-06512: at "SYS.UTL_MAIL", line 407
ORA-06512: at "SYS.UTL_MAIL", line 594
ORA-06512: at line 2
please do needful..
thanks in advance.
regards
dharmendra

But, you apparently do have an internet account (usually nowadays internet and email etc. is 'all included'), else you wouldn't be posting here. So, let's assume your provider is ACME and you live in Holland (= .nl), then you could try:
ALTER SYSTEM SET smtp_out_server='smtp.acme.nl' SCOPE=SPFILE;
You need to figure that out yourself, since we don't know who provides you internet access (nor whether it would work).
That would be the simplest way.
Not sure whether you can get gmail etc. to 'work with you': Re: utl.mail - smtp_out_server parameter

Similar Messages

  • How to send E-mails using JSP

    I developed a system where users can login and check for updated information and documents. But the changes are made once or twice in a year. I want to send email after changing the documents. I stored email addresses in the DB. Now the question is how to send e-mails to concerned users without using external software (Outlook, etc.). [Considering same subject and message for all e-mails.]

    Go to Java Mail forum:
    http://forum.java.sun.com/forum.jsp?forum=43

  • How to send e-mail using PL/SQL

    I need to send e-mail using PL/SQL. Is it possible?
    Thanks in advance,
    Agnaldo

    Yes. Use the UTL_SMTP package

  • How to send a mail using SMTPAppender in Log4j..?

    Hello friends,
    I'm new to this forum.
    I'm trying to send mail using SMTPAppender.
    I am getting this error..
    javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.DocumentBuilderFactory cannot be found
    at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:772)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:696)
    at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
    at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
    at org.apache.log4j.Logger.getLogger(Logger.java:105)
    at com.honeywell.logging.Log.<clinit>(Log.java:36)
    Exception in thread "main"
    Here is the code...
    Log.java
    package com.something.log;
    import org.apache.log4j.Logger;
    import org.apache.log4j.LogManager;
    import javax.mail.*;
    import javax.mail.internet.*;
    import org.apache.log4j.helpers.Loader;
    import org.apache.log4j.xml.DOMConfigurator;
    import java.net.URL;
    import java.util.*;
    import javax.mail.Message;
    import org.apache.log4j.PatternLayout;
    import org.apache.log4j.net.SMTPAppender;
    public class Main {
    * @param args the command line arguments
    private static final Logger lg=Logger.getLogger("com.something.log.Main");
    public static void main(String[] args) {
    URL url = Loader.getResource("log4j.xml");
                   DOMConfigurator.configure(url);
              // create email appender
         SMTPAppender smtpAppender = new SMTPAppender();
         smtpAppender.setTo("[email protected]");
         smtpAppender.setFrom("[email protected]");
         smtpAppender.setSMTPHost("smtp.something.com");
         smtpAppender.setSubject("Testing Email");
         smtpAppender.setLocationInfo(false);
         smtpAppender.setLayout(new PatternLayout("%d{ABSOLUTE} %5p %c{1}:%L - %m%n"));
         smtpAppender.activateOptions();
         // add email appender
         lg.addAppender(smtpAppender);
    log4j.xml
    <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
    <log4j:configuration>
         <appender name="file"
              class="org.apache.log4j.RollingFileAppender">
              <param name="maxFileSize" value="100KB" />
              <param name="maxBackupIndex" value="5" />
              <param name="File" value="logs/log.txt" />
              <param name="threshold" value="info"/>
              <layout class="org.apache.log4j.PatternLayout">
                   <param name="ConversionPattern"
                        value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n" />
              </layout>
         </appender>
         <appender name="mail" class="org.apache.log4j.net.SMTPAppender">
              <param name="SMTPHost" value="smtp.something.com" />
              <param name="From" value="[email protected]" />
              <param name="To" value="[email protected]" />
              <param name="Subject" value="[LOG] ..." />
              <param name="BufferSize" value="1" />
              <param name="threshold" value="error" />
              <layout class="org.apache.log4j.PatternLayout">
                   <param name="ConversionPattern"
                        value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n" />
              </layout>
         </appender>
         <root>
              <priority value="debug"></priority>
              <appender-ref ref="file" />
              <appender-ref ref="mail"/>
         </root>
    </log4j:configuration>
    log4j.properties
    log4j.rootLogger=warn, file, mail
    log4j.appender.file=org.apache.log4j.RollingFileAppender
    log4j.appender.file.maxFileSize=100KB
    log4j.appender.file.maxBackupIndex=5
    log4j.appender.file.File=D:\log.txt
    log4j.appender.file.threshold=info
    log4j.appender.file.layout=org.apache.log4j.PatternLayout
    log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
    #email appender
    log4j.appender.mail=org.apache.log4j.net.SMTPAppender
    #defines how othen emails are send
    log4j.appender.mail.BufferSize=1
    log4j.appender.mail.SMTPHost="smtp.something.com"
    [email protected]
    [email protected]
    log4j.appender.mail.Subject=Log ...
    log4j.appender.mail.threshold=error
    log4j.appender.mail.layout=org.apache.log4j.PatternLayout
    log4j.appender.mail.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
    Please help me in fixing the problem.....
    Is this code correct to send email...??

    I've not reviewed all of your code/config there, but the error seems to me to indicate a problem parsing your log4j.xml file - have you been able to get a simple configuration working? Can you parse other XML files?
    Good Luck
    Lee

  • How to send automated mail using Weblogic API ,,,,,, NOT Java Mail API.

    Hi All,
    I need to send an automated mail using BEA Weblogic API, can you please let me know how to accomplish this task,
    I will be heartly thankful to you,
    waiting for your response back
    naveen

    does it uses weblogic API ,, is thre any other way to do the task apart from email controls ,,,, because we are using timers and email control uses event genrators.

  • How to send e-mail using java mail api

    Hi can anyone tell me how to send mail using the javamail api, in short if possible an example code.

    Theres already lots of this code in the forums, use the search bar to the left.
    Also, there is a dedicated javaMail forum which you will find useful (you are currently in a JSP forum)
    http://forum.java.sun.com/forum.jspa?forumID=43

  • How to send Secured Mail using Java Mail?

    I want to send mails with "Send Secure" option using Java Mail. Now mails are being sent using Java Mail connecting to smtp host.
    Appreciating your help.
    Thanks.

    There are third party libraries to help with this. Bouncy Castle is very popular.
    See the [JavaMail Third Party Products|http://java.sun.com/products/javamail/Third_Party.html] page.

  • HOW TO SEND MULTIPLE MAILS USING EXTERNAL COMMUNICATION IN ACTIONS

    Hi all,
    we are working on a sales scenario in crm 5.0 ,currently we are able to send a mail to the particular BP only,what we want is mail should go to the multiple partners like contact person,prospect and user.can anyone help on this.
    Thanks in advance
    bye
    ram

    You can use the BADI: EXEC_METHODCALL_PPF for this. Use the piece of code below to get the guid, and then you can use CRM_ORDER_READ to get the partners. After that you can use the FM to send mails(Dont' remember the name right now) to send mails to all the partners. Hope this will help.
      "ASSIGN io_appl_object to
      DATA: lv_appl_object TYPE REF TO cl_doc_crm_order.
    cast object to application object
      lv_appl_object ?= io_appl_object.
      CALL METHOD lv_appl_object->get_crm_obj_guid
        RECEIVING
          result = ls_guid.

  • How to send a Mail using JSP using browser.

    Dear friends
    I could write a code to send a mail and execute it from a command prompt using a class file, but the same code, I converted into a JSP tags to run from a browser. I am getting compilation error. Can you please help me in solving this problem.
    I am using javamail API 1.3,JAF1.0.2
    Win2000,Websphere 3.5,HostPublisher server 3.5,IE6.0
    I shall be thankful if someone shows me the solution.

    Hello
    I hope that this is useful
    I'm using Tomacat 4.0.4 and J2SDK1.4.0_01
    Setting on conf\Server.xml
    <Resource name="mail/Session" auth="Container"
                        type="javax.mail.Session"/>
              <ResourceParams name="mail/Session">
                <parameter>
                  <name>mail.smtp.host</name>
                  <value>your hostmail server</value>
                </parameter>
              </ResourceParams>Setting on web.inf/web.xml
    <servlet>
        <servlet-name>SendMailServlet</servlet-name>
        <servlet-class>SendMailServlet</servlet-class>
      </servlet>
    <servlet-mapping>
        <servlet-name>SendMailServlet</servlet-name>
        <url-pattern>/SendMailServlet</url-pattern>
      </servlet-mapping>
    <resource-ref>
        <res-ref-name>mail/Session</res-ref-name>
        <res-type>javax.mail.Session</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>jsp page example:
    <html>
    <head>
    <title>Example Mail Sending Form</title>
    </head>
    <form method="POST" action="../../SendMailServlet">
    <table>
      <tr>
        <th align="center" colspan="2">
          Enter The Email Message To Be Sent
        </th>
      </tr>
      <tr>
        <th align="right">From:</th>
        <td align="left">
          <input type="text" name="mailfrom" size="60">
        </td>
      </tr>
      <tr>
        <th align="right">To:</th>
        <td align="left">
          <input type="text" name="mailto" size="60">
        </td>
      </tr>
      <tr>
        <th align="right">Subject:</th>
        <td align="left">
          <input type="text" name="mailsubject" size="60">
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <textarea name="mailcontent" rows="10" cols="80">
          </textarea>
        </td>
      </tr>
      <tr>
        <td align="right">
          <input type="submit" value="Send">
        </td>
        <td align="left">
          <input type="reset" value="Reset">
        </td>
      </tr>
    </table>
    </form>
    </body>
    </html>SendMailServelet.java:
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class SendMailServlet extends HttpServlet {
        public void doPost(HttpServletRequest request,
                           HttpServletResponse response)
            throws IOException, ServletException
            // Acquire request parameters we need
            String from = request.getParameter("mailfrom");
            String to = request.getParameter("mailto");
            String subject = request.getParameter("mailsubject");
            String content = request.getParameter("mailcontent");
            if ((from == null) || (to == null) ||
                (subject == null) || (content == null)) {
                RequestDispatcher rd =
                    getServletContext().getRequestDispatcher("/jsp/mail/sendmail.jsp");
                rd.forward(request, response);
                return;
            // Prepare the beginning of our response
            PrintWriter writer = response.getWriter();
            response.setContentType("text/html");
            writer.println("<html>");
            writer.println("<head>");
            writer.println("<title>Example Mail Sending Results</title>");
            writer.println("</head>");
            writer.println("<body bgcolor=\"white\">");
            try {
                // Acquire our JavaMail session object
                Context initCtx = new InitialContext();
                Context envCtx = (Context) initCtx.lookup("java:comp/env");
                Session session = (Session) envCtx.lookup("mail/Session");
                // Prepare our mail message
                Message message = new MimeMessage(session);
                message.setFrom(new InternetAddress(from));
                InternetAddress dests[] = new InternetAddress[]
                    { new InternetAddress(to) };
                message.setRecipients(Message.RecipientType.TO, dests);
                message.setSubject(subject);
                message.setContent(content, "text/plain");
                // Send our mail message
                Transport.send(message);
                // Report success
                writer.println("<strong>Message successfully sent!</strong>");
            } catch (Throwable t) {
                writer.println("<font color=\"red\">");
                writer.println("ENCOUNTERED EXCEPTION:  " + t);
                writer.println("<pre>");
                t.printStackTrace(writer);
                writer.println("</pre>");
                writer.println("</font>");
            // Prepare the ending of our response
            writer.println("<br><br>");
            writer.println("<a href=\"jsp/mail/sendmail.jsp\">Create a new message</a><br>");
            writer.println("</body>");
            writer.println("</html>");       
    }Ciao
    Riccardo

  • How to send a mail using vc

    hi,
    i have a requirement of sending a table which is displayed as a mail to the end users
    is there a possibilityof sending mails using vc
    please suggest me
    i will assign points

    Hi Venkat,
    you can not send emails from Visual Comoser without a web service. If you want to send BI reports you can use the BI broadcaster. You can also trigger the broadcaster from Visual Composer.
    If you want to send only the exception values you must filter the values and send the filtered values via email.
    E.g. you have a BI query exception revenue < 1.000.000 then you can filter in VC < 1.000.000 and pass the values to your email webservice.
    Best Regards,
    Marcel

  • How to send e-mails using CAF GP?

    Hi All,
    I have created a sample application which uses Process Control -> Visual Approval Callable Object for approving a vendor. I have also developed two mail templates for Approval and Rejection.
    The SMTP server is set to the mail server of the company.
    But the system is unable to send mails to the recipient. The following error message is displayed on clicking on "Approve":
    <i>Recipient data is missing.
    The system failed to send an e-mail notification to <Initiator>.</i>
    Can any of you suggest what the problem is and what is the possible workaround?
    Thanks in advance,
    Pavithra

    Hi Pavithra,
    Have u completed all the necessary configurations needed at the Visual Administrator level,
    You need to configure GP to be capable of picking the mails from your mail server at some regular intervals of time,
    You can refer to the document "Configuring GP for Interactive forms" at
    SAP Composite Application Framework - CAF Tutorial Center [original link is broken]
    Hope this will help,
    Rgds
    Deepak

  • How to setup and send mails using utl_mail on Oracle E-Biz R12

    Dear All
    There is a new requirement from client to setup and send mails using utl_mail utility on Oracle EBS R12.1.1
    What is utl_mail utility ? what is the difference between Workflow Notification Mailer and this utility/tool?
    What are etiquette's to pursue mail functionality in apps / db?
    - Chetan

    What is utl_mail utility
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_mail.htm
    How to Use the UTL_MAIL Package [ID 269375.1]
    FAQ and Known Issues While Using UTL_SMTP and UTL_MAIL [ID 730746.1]
    Master Note For PL/SQL UTL_SMTP and UTL_MAIL Packages [ID 1137673.1]
    Workflow Notification Mailer:
    you can send email using workflow notification email procedures,These ar built into the system and only need some minor configuration. check Workflow Administrator's Guide, Chapter 2, Section: Setting Up Notification Mailers for more detail.

  • How to bypass proxy when trying to send a mail using javamail smtp

    Hi,
    I am trying to make a servlet send a mail using javamail smtp protocol on port 25 but i m not able to send getting an exception, i suspect proxy is blocking, so any idea anyone how bypass a proxy.

    And if it does turn out that there's a proxy server blocking access to your target SMTP server, the best way to deal with that is to discuss the issue with the person responsible for your network configuration.

  • How to send a mail by ckicking the button using java

    hi,
    how to send a mail by clicking the button (like payroll silp in that contain one button if we click that it autometically go through the mail as a attachment) pls frd to me my gmail is [email protected]

    Hi,
    It seems we are doing the homework for you; to make you start with something; look at the sample code below and try to understand it first then put the right values
    to send an email with an attachement.
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.util.Date;
    import java.util.Properties;
    import javax.activation.DataHandler;
    import javax.activation.FileDataSource;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Multipart;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JTextField;
    public class Main {
          * @param args
         public static void main(String[] args) {
              // Create the frame
              String title = "Frame Title";
              JFrame frame = new JFrame(title);
              // Create a component to add to the frame
              JComponent comp = new JTextField();
              Action action = new AbstractAction("Button Label") {
                   // This method is called when the button is pressed
                   public void actionPerformed(ActionEvent evt) {
                        System.out.println("sending email with attachment");
                        sendEmail();
              // Create the button
              JButton button = new JButton(action);
              // Add the component to the frame's content pane;
              // by default, the content pane has a border layout
              frame.getContentPane().add(comp, BorderLayout.SOUTH);
              frame.getContentPane().add(button, BorderLayout.NORTH);
              // Show the frame
              int width = 300;
              int height = 300;
              frame.setSize(width, height);
              frame.setVisible(true);
         protected static void sendEmail() {
              String from = "me@localhost";
              String to = "me@localhost";
              String subject = "Important Message";
              String bodyText = "This is a important message with attachment";
              String filename = "c:\\tmp\\message.pdf";
              Properties properties = new Properties();
              properties.put("mail.stmp.host", "localhost");
              properties.put("mail.smtp.port", "25");
              Session session = Session.getDefaultInstance(properties, null);
              try {
                   MimeMessage message = new MimeMessage(session);
                   message.setFrom(new InternetAddress(from));
                   message.setRecipient(Message.RecipientType.TO, new InternetAddress(
                             to));
                   message.setSubject(subject);
                   message.setSentDate(new Date());
                   // Set the email message text.
                   MimeBodyPart messagePart = new MimeBodyPart();
                   messagePart.setText(bodyText);
                   // Set the email attachment file
                   MimeBodyPart attachmentPart = new MimeBodyPart();
                   FileDataSource fileDataSource = new FileDataSource(filename) {
                        @Override
                        public String getContentType() {
                             return "application/octet-stream";
                   attachmentPart.setDataHandler(new DataHandler(fileDataSource));
                   attachmentPart.setFileName(filename);
                   Multipart multipart = new MimeMultipart();
                   multipart.addBodyPart(messagePart);
                   multipart.addBodyPart(attachmentPart);
                   message.setContent(multipart);
                   Transport.send(message);
              } catch (MessagingException e) {
                   e.printStackTrace();
    }The sample above is not ideal so you need to go through it and start to ask me some questions if you have
    Let me know if you miss something
    Regards,
    Alan Mehio
    London,UK

  • How to send a mail in workflow keeping 1 receiver in CC and the other in TO

    Hi,
    Can anybody tell me how to send a mail in workflow keeping 1 receiver in CC and the other in TO.
    I need to send a mail to an employee keeping his/her manager in CC through workflow.
    Regards,
    Lavanya

    Hi Lavanya,
    I dont think its possible using Send mail step type.
    But it can be done by using the FM SO_NEW_DOCUMENT_SEND_API1. Just create a method and Call this FM accordingly.
    Thanks,
    Viji.

Maybe you are looking for

  • Purpose of advanced properties in sender mail adapter

    helo all. hi i just wanna know the usage of delete messages once read generate fetch report security parameters SMIME Default XI parameters                    under sender mail adapter. waiting for your great response. bye. regards. seeta ram.

  • "ORA-00903: invalid table name" when enqueue using a CLOB in an ADT payload

    I am attempting to enqueue into an AQ that has an ADT with a CLOB field in it. If I leave the CLOB empty, it works. As soon as I place content in it, I get the error below in the BPEL log. I actually get the same problem when I run the "AQ_ADT_with_C

  • Dynamic run-time objects in a query

    Hi everybody, I came across some docs that say this Dynamic SQL fails: CREATE PROCEDURE drop_table (table_name IN VARCHAR2) AS BEGIN EXECUTE IMMEDIATE ’DROP TABLE :tab’ USING table_name; END; Can someone explain why can't an object name be provided t

  • Information on built-in packages of HTMLDB

    Hi All, I have recently started working on HTMLDB. Can anybody tell me where from can i get information abt the built-in packages of HTMLDB. I have came across many like WWV_ . But, i dont know where from can i get detailed info abt them. Thanks in a

  • SD extractors - different number of records in RSA3 and in the table MC*

    Hi After deleting setup tables and creating it again for extractor 2LIS_11_VAITM I have in RSA3 - 64686 records but in MC11VA0ITMSETUP structure only 14857. The same situation is for 2LIS_11_VASTI. Where this difference is getting from? Thanks PWnuk