Not able to send mail through java

Hi,
I am sending an email through java but it gives me exception that Authentication failed exception but I have provided correct credentials
I have given stack trace as below
19 Mar 2013 16:32:58,579 614378 [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR alfaaesar.portal.pages.common.bo.AfCmnCommonBO  – AfCmnCommonBo SendMail Exception:javax.mail.AuthenticationFailedException
     at javax.mail.Service.connect(Service.java:319)
     at alfaaesar.portal.pages.common.bo.AfCmnCommonBO.sendMail(AfCmnCommonBO.java:939)
     at alfaaesar.portal.pages.literature.action.AfLitetatureRequestAndViewAction.InsertLiteratureReqDtlsInAlfaLitHeaderTbl(AfLitetatureRequestAndViewAction.java:619)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at com.sun.el.parser.AstValue.invoke(Unknown Source)
     at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
     at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
     at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
     at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
     at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
     at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
     at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
     at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
     at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
     at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
     at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
     at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at alfaaesar.portal.pages.filter.AnonymousSessionFilter.doFilter(AnonymousSessionFilter.java:47)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.portlet.client.adapter.adf.ADFPortletFilter.doFilter(ADFPortletFilter.java:32)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.webcenter.framework.events.dispatcher.EventDispatcherFilter.doFilter(EventDispatcherFilter.java:44)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
     at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
     at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.wcps.client.PersonalizationFilter.doFilter(PersonalizationFilter.java:75)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.webcenter.content.integration.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:168)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.webcenter.lifecycle.filter.LifecycleLockFilter.doFilter(LifecycleLockFilter.java:151)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
     at java.security.AccessController.doPrivileged(Native Method)
     at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
     at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
     at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
     at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
     at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
     at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
     at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)Also given code below in java to send an email .
                public  Boolean sendMail(String host,String port,String debugFlag,String authFlag, String userId,String password,String fromEmailAddress,String toEmailAddress,String subject,String eMailcontent ) throws MessagingException {
        Boolean sendMailFlag = false;
        Properties props = new Properties();
        props.put("mail.smtp.host", host);
        props.put("mail.smtp.port", port);
        props.put("mail.debug", debugFlag); //Set default to false
        props.put("mail.smtp.auth", authFlag); //Set default to true
        props.put("mail.transport.protocol", "smtp");
        props.put("mail.smtp.sendpartial","true");
       // props.put("mail.smtp.starttls.enable", "true");
        logger.info("Sending Email.......");
        //System.out.println("Sending Email.......");
        try {
            // Instantiatee a message
            final String mailUserId = userId;
            final String mailPassword = password;
           Session mailSession = Session.getDefaultInstance(props, new Authenticator() {
            protected PasswordAuthentication getPasswordAuthentication() {
            return new PasswordAuthentication(mailUserId, mailPassword);
           MimeMessage msg = new MimeMessage(mailSession);
            msg.setFrom(new InternetAddress(fromEmailAddress));
           String[] to = toEmailAddress.split(",");
           InternetAddress[] addressTo = new InternetAddress[to.length];
                 for (int i = 0; i < to.length; i++)
                     addressTo[i] = new InternetAddress(to);
msg.setRecipients(Message.RecipientType.TO, addressTo);
if(JSFUtils.getFromSession("ccEmailAddress")!=null){
String ccEmailAddress =(String)JSFUtils.getFromSession("ccEmailAddress");
JSFUtils.removeFromSession("ccEmailAddress");
String[] cc = ccEmailAddress.split(",");
InternetAddress[] addressCC = new InternetAddress[cc.length];
for (int i = 0; i < cc.length; i++)
addressCC[i] = new InternetAddress(cc[i]);
msg.setRecipients(Message.RecipientType.CC, addressCC);
msg.setSubject(subject,"utf-8");
msg.setSentDate(new Date());
//msg.setText(eMailcontent);
msg.setContent(eMailcontent, "text/html; charset=\"utf-8\"");
if (toEmailAddress.indexOf(',') > 0)
msg.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(toEmailAddress));
else
msg.setRecipient(Message.RecipientType.TO,
new InternetAddress(toEmailAddress));
Transport transport = mailSession.getTransport();
transport.connect(host,Integer.parseInt(port),userId.trim(),password.trim());
transport.send(msg);
transport.close();
//Send the message
// Transport.send(msg);
sendMailFlag = true;
// System.out.println("mail sent");
} catch (MessagingException mex) {
// Prints all nested (chained) exceptions as well
//logger.info(mex.getMessage());
logger.error("AfCmnCommonBo SendMail Exception:"+JSFUtils.getStackTrace(mex));
//mex.printStackTrace();
sendMailFlag = false;
return sendMailFlag;
Edited by: Wecenter Guru on Mar 19, 2013 5:02 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Hi All,
My question got resolved.It is due to the userId and fromEmailAddress was not of same account holder.because of which it is giving relaying denied type exception

Similar Messages

  • I am not able to send mails through Yahoo APP.It gives me an error msg :"the sender address has ben rejected by the server ".I tried adding username and password in the SMTP server settings,But those optiopns are greyed out.

    I am not able to send mails through Yahoo APP. It gives me an error msg :"the sender address has ben rejected by the server ".
    I tried adding username and password in the SMTP server settings,But those optiopns are greyed out.
    So, i am not able to enter anything in fields under SMTP server settings

    You probably have changing settings disabled in Restrictions.

  • I have an iphone 4s. able to receive all the incoming mails but not able to send mails through this iphone 4s. please help.

    I have an iphone 4s. able to receive all the incoming mails but not able to send mails through this iphone 4s. please help.

    delete and reinstall the email account.

  • I am using i pad mini. I am going through a issue in which i am not able to send mails to my work email add wherein i am able to receive emails from same email id.

    i am using i pad mini. I am going through a issue in which i am not able to send mails to my work email add wherein i am able to receive emails from same email id.

    With one mailbox server in the production site and one in the DR site, you do not have high availability.  If the main site goes down, the cluster loses quorum and all databases dismount.  You must then force quorum or move the file share
    witness to restore quorum.
    I can't tell you why what you observed happened.  At the time of the problem I would have been looking at the transport queues to see what's queued and to where.
    I recommend you look at the configuration of your send connectors to ensure that none of them are dependent upon the DR site server.
    To send mail outside, you must allow relay.  To do this, I recommend you create a new receive connector that's configured to allow relay and restrict access to the application server to keep anyone else from using it to relay.  There are plenty
    of articles on the Internet that describe how to configure a relay connector.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Notification mailer is not able to send mails to Outside domain i.e gmail

    Hi All,
    We are in 12.1.3 EBS application with 11.1.0.7 DB on Aix 64 bit platform:
    resently we configured notification mailer with out any issues
    But the issue is notifications are delivered to with in the domain itself but not to outside the domain i.e gmail and yahoo
    SMTP server host name is owa.craftsmanautomation.com the same we used to configure the Notification mailer
    Even we verified from os level using telnet utility as follows:
    $ telnet owa.craftsmanautomation.com 25
    Trying...
    Connected to 192.168.5.8.
    Escape character is '^]'.
    220 Capl-cas01.CRAFTSMAN.LOCAL Microsoft ESMTP MAIL Service ready at Thu, 12 Jul 2012 14:03:47 +0530
    EHLO CAPL-PROD
    250-Capl-cas01.CRAFTSMAN.LOCAL Hello [192.168.5.12]
    250-SIZE
    250-PIPELINING
    250-DSN
    250-ENHANCEDSTATUSCODES
    250-STARTTLS
    250-X-ANONYMOUSTLS
    250-AUTH NTLM
    250-X-EXPS GSSAPI NTLM
    250-8BITMIME
    250-BINARYMIME
    250-CHUNKING
    250-XEXCH50
    250-XRDST
    250 XSHADOW
    MAIL FROM: [email protected]
    250 2.1.0 Sender OK
    RCPT TO: [email protected]
    250 2.1.5 Recipient OK
    DATA
    354 Start mail input; end with <CRLF>.<CRLF>
    Subject: Test message
    Test message body
    250 2.6.0 <[email protected]> [InternalId=85753] Queued mail for delivery
    quit
    221 2.0.0 Service closing transmission channel
    Connection closed.
    In the above command in place of FROM and TO mail-id's if we use any personal mail-id's getting error message as "Unable to Relay".Please suggest is there any changes we need to done at SMTP server Level or OS level or Application Level.
    Thanks in Advance

    925263 wrote:
    Hi Hussein,
    Thanks Alot for your reply.
    Currently we changed the SMTP Server(mail.craftsmanautomation.com).we used anoth SMTP server to configure Notification Mailer.Because previous one(owa.craftsmanautomation.com) is not able to send mail's to outside domains.
    But in this case we got the below error message while testing.Below error message we captured from the output file of the script Oracle Workflow ATG Support: R12 Java Mailer Setup Diagnostic Test.
    ERROR
    [Nov 10, 2012 1:32:45 PM GMT+05:30]:1352534565017:-1:-1:capl-prod.craftsmanautomation.com:192.168.5.13:-1:-1:1:20420:SYSADMIN(0):-1:Thread[outboundThreadGroup1,5,outboundThreadGroup]:192.168.5.13:84096:1352529863628:11:ERROR:[SVC-GSM-WFMLRSVC-110812-10006 : oracle.apps.fnd.wf.mailer.SMTPOutboundProcessor.send(Message)]:Problem encountered when sending to {[[WFTEST <[email protected]>]]} -> javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
    class javax.mail.SendFailedException: 554 5.7.1 <[email protected]>: Sender address rejected: Access denied
    Please see these docs.
    Email Not Received javax.mail.SendFailedException: Invalid Addresses [ID 876835.1]
    Workflow Notification Mailer Unable to Send E-Mail Notifications [ID 374804.1]
    Unable to Email Proposal Documents to an 'External Address' [ID 1126223.1]
    How to address Email Center: Outbox Processor Error: Invalid Addresses [ID 1399427.1]
    Thanks,
    Hussein

  • I am not able to send mail - my outbox just spins

    I am not able to send mail from my ipod touch.  the message just keeps spinning and not sending

    - Does Safari work?
    - Try a reset. Nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Can you receive mail from that account?
    - Can you send mail with other accounts?
    - Try deleting the account for the iPod and reenter all the settings.

  • Application server sould not able to send mails once my DR Connetivity down....

     Hi all
    I am using my applications server to send mail through my exchange 2010 server. I also have my DR Site server for Exchange 2010 with DAG concept.
     please find below my server setups
    Main site
    1. Exchange MBX
    2.Exchange HUB/CAS
    3.Exchange Edge Server.
    DR site
    1. Exchange MBX/HUB/CAS
    2. Exchange Edge
    MBX Server are configured with DAG for Database High availlablity. we have p2p link between main site and DR Site.
    We created  the below receive connector in both our HUB server  for accept the mails from my applications server.
    1.  connector name : Application_ connector- selected the Custom option
    2. network --> use the local ip address to receive mail --> All available ipV4  port 25
    Receive mail from remote server that have these ip address --> 10.X.X.X --> my application server.
    3.Authentication --> basic authentication, Exchange server Authentication
    4.Permission group --> anonymous user, Exchange users, Exchange Servers, Legcy exchange servers.
     it was working fine  its send the mail  internally not issue.
    All the DBs are mounted in our main site Only.
    1. last week  my DR Site P2P link got down that time the mails sent from application server was not received by our users. I don't know why?
    2. once the Link got up the mail flow happened. For testing purpose I disabled the application receive connector in  DR HUB server and immediately the application mail flow got down.  since all the mail flow taking care by main site,   How
    my applications server mail itself taking my DR. I also checked my application server mail config and its configured with my main site HUB  server only.
    3.  now I also want  my application to send mail to external users.  How to enable this?  how secure it was?
    I am not able to complete the above issue for the past week. any body will help me to resolve the issue much appreciated....
    thanks in advance
    Jags

    With one mailbox server in the production site and one in the DR site, you do not have high availability.  If the main site goes down, the cluster loses quorum and all databases dismount.  You must then force quorum or move the file share
    witness to restore quorum.
    I can't tell you why what you observed happened.  At the time of the problem I would have been looking at the transport queues to see what's queued and to where.
    I recommend you look at the configuration of your send connectors to ensure that none of them are dependent upon the DR site server.
    To send mail outside, you must allow relay.  To do this, I recommend you create a new receive connector that's configured to allow relay and restrict access to the application server to keep anyone else from using it to relay.  There are plenty
    of articles on the Internet that describe how to configure a relay connector.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Not Able to Send Mail in Oracle Apex

    Hello Apex Experts,
      I am using Amazon Cloud  with details as using Oracle Apex 4.1 and Oracle 11g as database using Glass Fish Server.
    Problem am facing is E-Mail are not working. I tried adding our company smtp address but still it is not working.
    In Oracle Apex Admin scree Under Manage Instance --> Instance Settings --> Email tryed adding ( localhost and 10.1.1.100 SMT address ) this didnt work
    I am using below code to send mail 
    Begin
    -- Send plain text email
      APEX_MAIL.SEND(
        P_TO       =>  '[email protected]',
        P_FROM     =>  '[email protected]',
        P_CC       =>  '[email protected]',
        P_BCC      =>  '[email protected]',
        P_SUBJ     => 'test',
        P_BODY     => 'test');
       apex_mail.push_queue('10.1.1.100', 25);
    End;
    SELECT * FROM APEX_MAIL_QUEUE;
    I get ORA-24247: network access denied by access control list (ACL) . I also see last_updated as SYS in the log
    Please suggest me how to fix this issue.
    Thanks
    Sudhir

    Hi Mike,
      Thanks for your reply, Let me give you a detail on where we are stuck on send mail.
       We have a Schema called PORTAL
      We are able to send mail from UTL_SMTP as mentioned below in a procedure
    create or replace PROCEDURE send_mail (p_to        IN VARCHAR2,
                                           p_from      IN VARCHAR2,
                                           p_message   IN VARCHAR2,
                                           p_smtp_host IN VARCHAR2,
                                           p_smtp_port IN NUMBER DEFAULT 25)
    AS
      l_mail_conn   UTL_SMTP.connection;
    BEGIN
      l_mail_conn := UTL_SMTP.open_connection(p_smtp_host, p_smtp_port);
      UTL_SMTP.helo(l_mail_conn, p_smtp_host);
      UTL_SMTP.mail(l_mail_conn, p_from);
      UTL_SMTP.rcpt(l_mail_conn, p_to);
      UTL_SMTP.data(l_mail_conn, p_message || UTL_TCP.crlf || UTL_TCP.crlf);
      UTL_SMTP.quit(l_mail_conn);
    END;
    Begin
    send_mail('[email protected]','[email protected]','test','10.0.0.100','25');
    End;
    The above code works i am able to send and receive mails.
    We also create ACL as mentioned below
    begin
    dbms_network_acl_admin.create_acl (
    acl => 'http_permission.xml', -- or any other name
    description => 'HTTP Access',
    principal => 'APEX_040100', -- the user name trying to access the network resource
    is_grant => TRUE,
    privilege => 'connect',
    start_date => null,
    end_date => null
    end;
    commit;
    SELECT * FROM dba_network_acl_privileges where principal='APEX_040100';
    begin
    DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl => 'http_permission.xml',
    principal => 'APEX_040100',
    is_grant => true,
    privilege => 'connect');
    end;
    commit;
    begin
    DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl => 'http_permission.xml',
    principal => 'APEX_040100',
    is_grant => true,
    privilege => 'resolve');
    end;
    commit;
    BEGIN
    dbms_network_acl_admin.assign_acl (
    acl => 'http_permission.xml',
    host => '10.1.1.100', /*can be computer name or IP , wildcards are accepted as well for example - '*.us.oracle.com'*/
    lower_port => 80,
    upper_port => 80
    END;
    But still we are getting same ACL Error Please suggest US
    ORA-24247: network access denied by access control list (ACL)
    Thanks
    Sudhir

  • Others not able to send mail to my account

    I have manually entered all the information as my hosting website has provided and I am able to send mail but others are not able to sen mail to me.
    The following message occurs every attempt to send to my account:
    Delivery to the following recipient failed permanently:
    [email protected]
    Technical details of permanent failure:
    Google tried to deliver your message, but it was rejected by the server for the recipient domain microciderco.com.au by aspmx.l.google.com. [2607:f8b0:400d:c00::1a].
    The error that the other server returned was:
    550-5.1.1 The email account that you tried to reach does not exist. Please try
    550-5.1.1 double-checking the recipient's email address for typos or
    550-5.1.1 unnecessary spaces. Learn more at
    550 5.1.1 http://support.google.com/mail/bin/answer.py?answer=6596 i68si5152525qgd.15 - gsmtp

    Well the domain passes most standard checks. http://www.dnsstuff.com/tools#dnsReport|type=domain&&value=microciderco.com.au
    Google, whom I assume are your hosts are emphatic when I send mail to that address that the address simply does not exist. So I think you need to revisit that part of your domain setup. perhaps create a couple of other addresses and see if they play nice.

  • Issue with sending mail through java stored procedure in Oracle

    Hello
    I am using Oracle 9i DB. I created a java stored procedure to send mail using the code given below. The java class works fine standalone. When its run from Java, mail is sent as desired. But when the java stored procedure is called from pl/sql "Must issue a STARTTLS command first" error is thrown. Please let me know if am missing something. Tried the same code in 11.2.0.2 DB and got the same error
    Error:
    javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first. va6sm31201010igc.6
    Code for creating java stored procedure: (T1 is the table created for debugging)
    ==================================================
    create or replace and compile java source named "MailUtil1" AS
    import java.util.Enumeration;
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    public class MailUtil1 {
    public static void sendMailwithSTARTTLS(String host, //smtp.projectp.com
    String from, //sender mail id
    String fromPwd,//sender mail pwd
    String port,//587
    String to,//recepient email ids
    String cc,
    String subject,
    String messageBody) {
    try{
    Properties props = System.getProperties();
    props.put("mail.smtp.starttls.enable", "True"); // added this line
    props.put("mail.smtp.host", host);
    props.put("mail.smtp.user", from);
    props.put("mail.smtp.password", fromPwd);
    props.put("mail.smtp.port", port);
    props.put("mail.smtp.auth", "true");
    #sql { insert into t1 (c1) values ('1'||:host)};
    Session session = Session.getDefaultInstance(props, null);
    MimeMessage message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    #sql { insert into t1 (c1) values ('2')};
    InternetAddress[] toAddress = new InternetAddress[1];
    // To get the array of addresses
    for( int i=0; i < toAddress.length; i++ ) { // changed from a while loop
    toAddress[i] = new InternetAddress(to);
    //System.out.println(Message.RecipientType.TO);
    for( int i=0; i < toAddress.length; i++) { // changed from a while loop
    message.addRecipient(Message.RecipientType.TO, toAddress);
    if (cc!=null) {
    InternetAddress [] ccAddress = new InternetAddress[1];
    for(int j=0;j<ccAddress.length;j++){
    ccAddress[j] = new InternetAddress(cc);
    for (int j=0;j<ccAddress.length;j++){
    message.addRecipient(Message.RecipientType.CC, ccAddress[j]);
    message.setSubject(subject);
    message.setText(messageBody);
    message.saveChanges();
    #sql { insert into t1 (c1) values ('3')};
    Enumeration en = message.getAllHeaderLines();
    String token;
    while(en.hasMoreElements()){
    token ="E:"+en.nextElement().toString();
    #sql { insert into t1 (c1) values (:token)};
    token ="ConTyp:"+message.getContentType();
    #sql { insert into t1 (c1) values (:token)};
    token = "Encod:"+message.getEncoding();
    #sql { insert into t1 (c1) values (:token)};
    token = "Con:"+message.getContent();
    #sql { insert into t1 (c1) values (:token)};
    Transport transport = session.getTransport("smtp");
    #sql { insert into t1 (c1) values ('3.1')};
    transport.connect(host, from, fromPwd);
    #sql { insert into t1 (c1) values ('3.2')};
    transport.sendMessage(message, message.getAllRecipients());
    #sql { insert into t1 (c1) values ('3.3')};
    transport.close();
    #sql { insert into t1 (c1) values ('4')};
    catch(Exception e){
    e.printStackTrace();
    String ex= e.toString();
    try{
    #sql { insert into t1 (c1) values (:ex)};
    catch(Exception e1)
    Edited by: user12050615 on Jan 16, 2012 12:18 AM

    Hello,
    Thanks for the reply. Actually I have seen that post before creating this thread. I thought that I could make use of java mail to work around this problem. I created a java class that succesfully sends mail to SSL host. I tried to call this java class from pl-sql through java stored procedure. That did not work
    So, is this not supported in Oracle ? Please note that I have tested this in both 9i and 11g , in both the versions I got the error. You can refer to the code in the above post.
    Thanks
    Srikanth
    Edited by: user12050615 on Jan 16, 2012 12:17 AM

  • Can anybody help on sending mail through Java Code

    I am trying to send the mail using the java code and I am unable to do it. My code is
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.text.*;
    public class EmailExample {
    public static void main(String[] args)
    Socket smtpSocket;
    DataOutputStream os;
    BufferedReader is;
    Date dDate = new Date();
    DateFormat dFormat = DateFormat.getDateInstance(DateFormat.FULL,Locale.US);
    try
    smtpSocket = new Socket("www.gmail.com",80);
    os = new DataOutputStream(smtpSocket.getOutputStream());
    is = new BufferedReader(new InputStreamReader(smtpSocket.getInputStream()));
    System.out.println("Hi How is this?");
    os.writeBytes("HELLO\r\n");
    // You will add the email address that the server
    // you are using know you as.
    os.writeBytes("MAIL From: <[email protected]>\r\n");
    // Who the email is going to.
    os.writeBytes("RCPT To: <[email protected]>\r\n");
    //IF you want to send a CC then you will have to add this
    //os.writeBytes("RCPT Cc: <[email protected]>\r\n");
    // Now we are ready to add the message and the
    // header of the email to be sent out.
    os.writeBytes("DATA\r\n");
    os.writeBytes("X-Mailer: Via Java\r\n");
    os.writeBytes("DATE: " + dFormat.format(dDate) + "\r\n");
    System.out.println("DATE: " + dFormat.format(dDate) + "\r\n");
    os.writeBytes("From: Me <[email protected]>\r\n");
    os.writeBytes("To: YOU <[email protected]>\r\n");
    //Again if you want to send a CC then add this.
    //os.writeBytes("Cc: CCDUDE <[email protected]>\r\n");
    //Here you can now add a BCC to the message as well
    //os.writeBytes("RCPT Bcc: BCCDude<[email protected]>\r\n");
    String sMessage = "Your subjectline here";
    os.writeBytes("Subject: Your subjectline here\r\n");
    os.writeBytes(sMessage + "\r\n");
    os.writeBytes("\r\n.\r\n");
    os.writeBytes("QUIT\r\n");
    // Now send the email off and check the server reply.
    // Was an OK is reached you are complete.
    String responseline;
    while((responseline = is.readLine())!=null)
    {   System.out.println(responseline);
    if(responseline.indexOf("Ok") != -1)
    break;
    } catch (IOException e) {
    e.printStackTrace();
    It is compiling and runnung properly. Please Help me on this.
    Thanks.
    Satya.

    You're mishandling the responses. You terminate if you don't get an "Ok" string, but that's not how success is defined - you should get a 200 code back, typically with an "OK" (not caps) message.
    It doesn't help that you're ignoring all of the server output after each command, so you never find out if anything goes wrong.
    You're also reinventing a wheel. The JavaMail API exists for this: http://java.sun.com/products/javamail/

  • Not able to send mail after Embarq took over Sprint

    After over three hours on the phone with Embarq, I finally am able to receive mail but not send. They claim it is a problem with Apple Mail. I never had this proble untill the change over from Sprint to Emgarq. This is the message I receive when I try to send mail;
    "This message could not be delivered and will remain in your Outbox until it can be delivered.
    Verify that you have addressed this message correctly. Check your SMTP server settings in Mail Preferences and verify any advanced settings with your system administrator."
    I am seriously thinking about dumping Embarq and going with cable.
    Any suggestions?
    David

    Hi Thanks for the tips with the Embarq trouble. Just to pass on a word of success on the proper setting with these guys. The Incoming Mail Server: pop.embarqmail.com The User Name will be your email address, don't drop the @embarqmail.com it won't work without it. Enter your password for the incoming server. The outgoing will be smtp.embarqmail.com:email address. It kind of looks goofy but it just like the incoming, but swap the pop for SMTP. My server port is still set at 25 and you'll need to add the password here as well. I sent a test email yesterday. I could view it on the webmail, but had no success on Mail 2.1, until today. Thanks for the info being posted. This is not a typical setup for an account on Mail. They kept on telling me the user name was everything before the @ when in fact it's your whole email address.
    Hope this helps.

  • Reg : Problem in Sending Mail Through Java Code

    Hi All,
    I wrote java code to send email to gmail. But am getting the error as following .
    Error:
    C:\jdevstudio10134\jdk\bin\javaw.exe -client -classpath "C:\jdevstudio10134\jdev\mywork\Prasad\Project1\classes;C:\Program Files\Java\jre1.5.0_14\lib\j2ee.jar" tips.mails.SendMailTest
    javax.mail.SendFailedException: Sending failed;
    nested exception is:
         class javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 995
         at javax.mail.Transport.send0(Transport.java:218)
         at javax.mail.Transport.send(Transport.java:80)
         at tips.mails.SendMail.send(SendMail.java:53)
         at tips.mails.SendMailTest.main(SendMailTest.java:13)
    Process exited with exit code 0.
    Class :
    package tips.mails;
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.Message.RecipientType;
    import javax.mail.internet.AddressException;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    public class SendMail {
         private String from;
         private String to;
         private String subject;
         private String text;
         public SendMail(String from, String to, String subject, String text){
              this.from = from;
              this.to = to;
              this.subject = subject;
              this.text = text;
         public void send(){
              Properties props = new Properties();
              props.put("mail.smtp.host", "smtp.gmail.com");
              props.put("mail.smtp.port", "995");
              Session mailSession = Session.getDefaultInstance(props);
              Message simpleMessage = new MimeMessage(mailSession);
              InternetAddress fromAddress = null;
              InternetAddress toAddress = null;
              try {
                   fromAddress = new InternetAddress(from);
                   toAddress = new InternetAddress(to);
              } catch (AddressException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              try {
                   simpleMessage.setFrom(fromAddress);
                   simpleMessage.setRecipient(RecipientType.TO, toAddress);
                   simpleMessage.setSubject(subject);
                   simpleMessage.setText(text);
                   Transport.send(simpleMessage);               
              } catch (MessagingException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    ==============================================================================
    Main Class :
    package tips.mails;
    public class SendMailTest {
         public static void main(String[] args) {
              String from = "[email protected]";
              String to = "[email protected]";
              String subject = "Hi Rekha";
              String message = "A test message";
              SendMail sendMail = new SendMail(from, to, subject, message);
              sendMail.send();
    ========================
    Please help me on this .
    Thanks in Advance.

    Hi,
    smtp.gmail.com port is : 587/465
    pop.gmail.com port is : 995
    if u r using ssl connection then use port 465 for smtp.gmail.com. if u r using non-ssl connection means TLS type then u should use port 587 for smtp.gmail.com.
    For any further assistance u can refer to this forum - http://forums.sun.com/forum.jspa?forumID=43 assuming u r using javamail api.

  • Not able to send mail

    I am currently using the latest Leopard update.
    I have a Macbook Pro. 2.2.
    Anyway. I recently noticed that I'm unable to send mail using the Mail program. I get an error saying: The connection to the server “smtp.mac.com” on port 25 timed out.
    What could be the problem? Any suggestions on how to fix this?
    Thanks.
    Ryan

    Go to the account settings and change the port for the SMTP-server from 25 to 587. Take care to really change the SMTP-server settings (which means: do only change "25"'s to 587, do not change other ports).

  • Not able to send mail thru Oracle

    Hi all,
    I am using Oracle 9.2.0.6 on RHEL platform.....
    I am using the below procedure to send mail from oracle
    CREATE or REPLACE PROCEDURE SimpleTextMessage IS
        mailHOST    VARCHAR2(64) := '10.0.1.2';
        mailFROM    VARCHAR2(64);
        mailTO      VARCHAR2(64);
        mailCONN    utl_smtp.connection;
        mailDATE    VARCHAR2(20);
        vreply      utl_smtp.reply;
        vreplies    utl_smtp.replies;
        i           number;
    BEGIN
        mailFROM := '[email protected]';
        mailTO   := '[email protected]';
        SELECT TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS') INTO mailDATE FROM dual;
          dbms_output.put_line('open_connection');
          dbms_output.put_line('---------------');
          vreply := utl_smtp.open_connection(mailHOST, 25, mailCONN);
          dbms_output.put_line( 'code = ' || vreply.code );
          dbms_output.put_line( 'text = ' || vreply.text );
          dbms_output.put_line('help');
          dbms_output.put_line('----');
          vreplies := utl_smtp.help(mailCONN, 'HELP');
          for i in 1..vreplies.count loop
            dbms_output.put_line( 'code = ' || vreplies(i).code );
            dbms_output.put_line( 'text = ' || vreplies(i).text );
          end loop;
    vreply := utl_smtp.open_data(mailCONN);
          utl_smtp.write_data(mailCONN, 'Subject: '|| 'A subject' || chr(13));
          utl_smtp.write_data(mailCONN, 'From:    '||mailFROM     || chr(13));
          utl_smtp.write_data(mailCONN, 'Date:    '||mailDATE     || chr(13));
          utl_smtp.write_data(mailCONN, 'To:      '||mailTO       || chr(13));
          utl_smtp.write_data(mailCONN, 'CC:      '||mailFROM     || chr(13));
          utl_smtp.write_data(mailCONN, 'BCC:     '||mailFROM     || chr(13));
          utl_smtp.write_data(mailCONN,                              chr(13));
          utl_smtp.write_data(mailCONN, 'Hello Friend.'           || chr(13));
          utl_smtp.write_data(mailCONN, 'Drop me an e-mail.'      || chr(13));
          dbms_output.put_line('close_data');
          dbms_output.put_line('----------');
          vreply := utl_smtp.close_data(mailCONN);
          dbms_output.put_line( 'code = ' || vreply.code );
          dbms_output.put_line( 'text = ' || vreply.text );
          dbms_output.put_line('quit');
          dbms_output.put_line('----');
          vreply := utl_smtp.quit(mailCONN);
          dbms_output.put_line( 'code = ' || vreply.code );
          dbms_output.put_line( 'text = ' || vreply.text );
    END;
    /At the time of compilation i am not getting any error but when i call that proc i am getting the below error:
    SQL> exec cadata3.simpletextmessage();
    BEGIN cadata3.simpletextmessage(); END;
    ERROR at line 1:
    ORA-29277: invalid SMTP operation
    ORA-06512: at "SYS.UTL_SMTP", line 43
    ORA-06512: at "SYS.UTL_SMTP", line 279
    ORA-06512: at "CADATA3.SIMPLETEXTMESSAGE", line 29
    ORA-06512: at line 1can asomebody throw some light on the same....

    Still getting the same problem
    CREATE or REPLACE PROCEDURE SimpleTextMessage IS
        mailHOST    VARCHAR2(64) := '10.0.1.2:8443';
        mailFROM    VARCHAR2(64);
        mailTO      VARCHAR2(64);
        mailCONN    utl_smtp.connection;
        mailDATE    VARCHAR2(20);
        vreply      utl_smtp.reply;
        vreplies    utl_smtp.replies;
        i           number;
    BEGIN
        mailFROM := '[email protected]';
        mailTO   := '[email protected]';
        SELECT TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS') INTO mailDATE FROM dual;
          dbms_output.put_line('open_connection');
          dbms_output.put_line('---------------');
          vreply := utl_smtp.open_connection(mailHOST, 25, mailCONN);
          dbms_output.put_line( 'code = ' || vreply.code );
          dbms_output.put_line( 'text = ' || vreply.text );
          dbms_output.put_line('help');
          dbms_output.put_line('----');
          vreplies := utl_smtp.help(mailCONN, 'HELP');
          for i in 1..vreplies.count loop
            dbms_output.put_line( 'code = ' || vreplies(i).code );
            dbms_output.put_line( 'text = ' || vreplies(i).text );
          end loop;
    vreply := utl_smtp.close_data(mailCONN);
          utl_smtp.write_data(mailCONN, 'Subject: '|| 'A subject' || chr(13));
          utl_smtp.write_data(mailCONN, 'From:    '||mailFROM     || chr(13));
          utl_smtp.write_data(mailCONN, 'Date:    '||mailDATE     || chr(13));
          utl_smtp.write_data(mailCONN, 'To:      '||mailTO       || chr(13));
          utl_smtp.write_data(mailCONN, 'CC:      '||mailFROM     || chr(13));
          utl_smtp.write_data(mailCONN, 'BCC:     '||mailFROM     || chr(13));
          utl_smtp.write_data(mailCONN,                              chr(13));
          utl_smtp.write_data(mailCONN, 'Hello Friend.'           || chr(13));
          utl_smtp.write_data(mailCONN, 'Drop me an e-mail.'      || chr(13));
          dbms_output.put_line('close_data');
          dbms_output.put_line('----------');
          vreply := utl_smtp.close_data(mailCONN);
          dbms_output.put_line( 'code = ' || vreply.code );
          dbms_output.put_line( 'text = ' || vreply.text );
          dbms_output.put_line('quit');
          dbms_output.put_line('----');
          vreply := utl_smtp.quit(mailCONN);
          dbms_output.put_line( 'code = ' || vreply.code );
          dbms_output.put_line( 'text = ' || vreply.text );
    END;
    /error
    SQL> exec cadata3.simpletextmessage();
    BEGIN cadata3.simpletextmessage(); END;
    ERROR at line 1:
    ORA-29277: invalid SMTP operation
    ORA-06512: at "SYS.UTL_SMTP", line 43
    ORA-06512: at "SYS.UTL_SMTP", line 303
    ORA-06512: at "CADATA3.SIMPLETEXTMESSAGE", line 28
    ORA-06512: at line 1Edited by: user00726 on Jul 31, 2009 4:14 AM

Maybe you are looking for

  • How Do I Watch Movies (Stored On iPod) On My TV?

    I have a movie on my iPod that I want to watch on my TV. What do I need to do? Do I need a special wire? If so, where do I plug it into the iPod and where do I plug it into my TV?

  • White line across screen.

    Here's a picture of the problem http://i139.photobucket.com/albums/q319/Rob1302_album/ipodfk.jpg?t=1231786566 You can see the line across the top which stays on every screen. I haven't used my ipod in about a week and this wasn't there before. I turn

  • I want Query from QueryDataSet by SQL string, Is it possible ??

    if the sql string is : "select * from QueryDataset1 " and store the results in another QueryDataSetRR is it possible or not ? What ara the alternatves of store the retrived data from database and store it in (??) instead querdataset1 and use these da

  • Does br Not work for Safari Browser?

    Using Safari on Vista If you look here http://www.banquettables.pro/ When you add an item to the cart, there is a shopping cart that appears using ajax in the right column. THIS Text Below shows up. You may checkout online securely, or call and order

  • No right click with evantech touchpad

    I have a Samsung QX410 with a ETPS/2 Elantech ETF1059 Click-Pad touchpad (as reported in Xorg.0.log). I'm getting this to work using the psmouse-evantech driver in the AUR, which allows me to use the standard synaptics tools to configure the touchpad