8 Replies Latest reply: Mar 6, 2013 8:56 AM by pt_user1 RSS

    E-mail notification through package/procedure in ODI

    pt_user1
      Hi,
      I need to send an e-mail notification for success and failure of an interface.

      I followed the below link:
      http://dwteam.in/send-mail-in-odi-using-gmail-credentials/#comment-4831

      It is working fine for gmail, but when I try for my official id.
      It is showing error. (Could not connect) (Permission denied)
      How to resolve it ???


      Thanks.
        • 1. Re: E-mail notification through package/procedure in ODI
          Bhabani Ranjan
          odi has its own sendmail tool. Try to use it.
          Note: For OdiSendMail , use a mail server which does not requires an authentication

          I have posted there because many newbies are trying to learn ODI and they dont have such mail server. So that is one alternative to do the same using gmail credentials.
          • 2. Re: E-mail notification through package/procedure in ODI
            pt_user1
            Hi,
            I tried to get the SMTP IP by:
            ping mail.xyz.com

            Is it the right way??

            Then I mentioned the IP address in the below code:

            OdiSendMail "-MAILHOST=IP address of SMTP" "-FROM=pmt@xyz.com" "-SUBJECT=ODI: Failure notification" "-TO=pmt@xyz.com"

            When I execute, it is giving the following error.

            javax.mail.MessagingException: Could not connect to SMTP host: 1.2.3.4, port: 25;
            nested exception is:
                 java.net.SocketException: Permission denied: connect
                 at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
                 at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
                 at javax.mail.Service.connect(Service.java:275)
                 at javax.mail.Service.connect(Service.java:156)
                 at javax.mail.Service.connect(Service.java:105)
                 at javax.mail.Transport.send0(Transport.java:168)
                 at javax.mail.Transport.send(Transport.java:98)
                 at com.sunopsis.dwg.tools.SendMail.actionExecute(SendMail.java:172)
                 at com.sunopsis.dwg.function.SnpsFunctionBase.execute(SnpsFunctionBase.java:276)
                 at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execIntegratedFunction(SnpSessTaskSql.java:3437)
                 at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeOdiCommand(SnpSessTaskSql.java:1509)
                 at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:44)
                 at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:1)
                 at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
                 at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
                 at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
                 at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
                 at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
                 at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
                 at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
                 at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
                 at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
                 at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
                 at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
                 at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
                 at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
                 at java.lang.Thread.run(Thread.java:722)
            Caused by: java.net.SocketException: Permission denied: connect
                 at java.net.DualStackPlainSocketImpl.connect0(Native Method)
                 at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
                 at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:337)
                 at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:198)
                 at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
                 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
                 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
                 at java.net.Socket.connect(Socket.java:579)
                 at java.net.Socket.connect(Socket.java:528)
                 at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
                 at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
                 at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
                 ... 26 more

            Thanks.

            Edited by: pt_user on Mar 4, 2013 2:23 AM
            • 3. Re: E-mail notification through package/procedure in ODI
              Tina.Wang-Oracle
              check whether your office mail server is ssl enabled, generally it's enabled, you can check server setting in your outlook or thunderbird. if ssl enabled, it's hard to use odisendmail
              • 4. Re: E-mail notification through package/procedure in ODI
                897978
                import smtplib
                server = smtplib.SMTP('xxxmail')
                From = 'XXX'
                To = '#EMAIL_RECIPIENT'
                Subject = ' '.join([
                '#PLATFORM'
                ,'<%=snpRef.getSession("CONTEXT_NAME")%>'
                ,'<%=snpRef.getSession( "SESS_NAME" )%>'
                ,'<%=odiRef.getPrevStepLog("STEP_NAME")%>'
                ,'Finished'
                ])
                MessageString = """<%=odiRef.getPrevStepLog("MESSAGE")%>"""
                MessageString = MessageString[:MessageString.find('\tat')] #Strip off the garbage
                if not MessageString:
                MessageString = 'No previous step log message\n'

                Message="From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%s" % (From,To,Subject,MessageString)
                server.sendmail(From,To,Message)
                • 5. Re: E-mail notification through package/procedure in ODI
                  733367
                  Hi The required SMTP server port needs to be open.
                  • 6. Re: E-mail notification through package/procedure in ODI
                    pt_user1
                    Hey will you please guide me as in where to check the status of SSL in outlook.

                    Thanks.
                    • 7. Re: E-mail notification through package/procedure in ODI
                      pt_user1
                      How to check the same.


                      Thanks.
                      • 8. Re: E-mail notification through package/procedure in ODI
                        pt_user1
                        Hi,
                        There are certain restrictions laid on the SMTP server.
                        That is why it is not working.


                        Thanks.