Authentication Failed Exception while reading mail using POP

Hi,
I am using POP3 for reading mails from mail id. When I try to read the mail from Microsoft Exchange server 2007, it is a success. But same code is giving "Authentication Failed Exception" with Microsoft Exchange server 2010.
One more difference, I figured out. Microsoft Exchange server 2007 is having NTLM as LoginType and code works fine with it. Where as Microsoft Exchange server 2010 is having TLS as LoginType and code is giving "Authentication Failed Exception".
Line of code which is giving exception is...
store = session.getStore(providerPOP3);
store.connect(host, user, password); //throws exception
Please advice how this code can work with Microsoft Exchange server 2010 having TLS as LoginType.
Regards,

Thanks for your reply.
Yes, I am using javamail 1.4.3. My code is working fine with Exchange server 2007 having NTLM.
But when I changed the credentials as per mail id configured on Exchange Server 2010 having TLS support, it did not work. Can you please help what code change would be required to read mails from mail id configured on Exchage Server 2010 having TLS support.
Sorry, if my point seems not understandable as I am as new with these terminologies (mail server and all) as baby with world. :)
Thanks for supprt.

Similar Messages

  • Getting exceptions while sending mail using javamail api

    Hi to all
    I am developing an application of sending a mail using JavaMail api. My program is below:
    quote:
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    public class sms
    public static void main(String args[])
    try
    String strstrsmtserver="smtp.bol.net.in";
    String strto="[email protected]";
    String strfrom="[email protected]";
    String strsubject="Hello";
    String bodytext="This is my first java mail program";
    sms s=new sms();
    s.send(strstrsmtserver,strto,strfrom,strsubject,bodytext);
    catch(Exception e)
    System.out.println("usage:java sms"+"strstrsmtpserver tosddress fromaddress subjecttext bodyText");
    System.exit(0);
    public void send(String strsmtpserver,String strto,String strfrom ,String strsubject,String bodytext)
    try
    java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    Properties p=new Properties(System.getProperties());
    if(strsmtpserver!=null)
    p.put("mail.transport.protocol","smtp");
    p.put("mail.smtp.host","[email protected]");
    p.put("mail.smtp.port","25");
    Session session=Session.getDefaultInstance(p);
    Message msg=new MimeMessage(session);
    Transport trans = session.getTransport("smtp");
    trans.connect("smtp.bol.net.in","[email protected]","1234563757");
    msg.setFrom(new InternetAddress(strfrom));
    msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(strto,false));
    msg.setSubject(strsubject);
    msg.setText(bodytext);
    msg.setHeader("X-Mailer","mtnlmail");
    msg.setSentDate(new Date());
    Transport.send(msg);
    System.out.println("Message sent OK.");
    catch(Exception ex)
    System.out.println("here is error");
    ex.printStackTrace();
    It compiles fine but showing exceptions at run time.Please help me to remove these exceptions.I am new to this JavaMail and it is my first program of javamail.Please also tell me how to use smtp server.I am using MTNL 's internet connection having smtp.bol.net.in server.
    exceptions are:
    Here is exception
    quote:
    Javax.mail.MessagingException:Could not connect to SMTP host : smtp.bol.net.in, port :25;
    Nested exception is :
    Java.net.ConnectException:Connection refused: connect
    At com.sun.mail.smtp.SMTPTransport.openServer<SMTPTransport.java:1227>
    At com.sun.mail.smtp.SMTPTransport.protocolConnect<SMTPTransport.java:322>
    At javax.mail.Service .connect(Service.java:236>
    At javax.mail.Service.connect<Service.java:137>
    At sms.send<sms.java:77>
    At sms.main<sms.java:24>

    Did you find the JavaMail FAQ?
    You should talk to your ISP to get the details for connecting to your server.
    In this case I suspect your server wants you to make the connection on the
    secure port. The FAQ has examples of how to do this for GMail and Yahoo
    mail, which work similarly. By changing the host name, these same examples
    will likely work for you.

  • While reading mail using imap timed out exception thrown

    Properties props =new Properties();
    // Properties props = System.getProperties();
    props.setProperty("mail.imaps.socketFactory.class","javax.net.ssl.SSLSocketFactory");
    props.setProperty("mail.imaps.socketFactory.fallback", "false");
    props.setProperty("mail.imaps.port", "143");
    props.setProperty("mail.imaps.socketFactory.port", "143");
    props.setProperty("mail.imaps.ssl.enable","true");
    props.setProperty("mail.imaps.connectiontimeout", "300000");
    props.setProperty("mail.imaps.timeout", "900000");
    props.setProperty("mail.imaps.connectiontimeout", "300000");
    props.setProperty("mail.imaps.statuscachetimeout", "3000000");
    props.setProperty("mail.imaps.connectionpooltimeout", "3000000");
    Session session = Session.getDefaultInstance(props, null);
    session.setDebug(true);
    store = session.getStore("imaps");
    session.setDebug(true);
    store.connect(popServer, popUser, popPassword);
    // -- Try to get hold of the default folder --
    folder = store.getDefaultFolder();
    if (folder == null) throw new Exception("No default folder");
    // -- ...and its INBOX --
    folder = folder.getFolder("INBOX");
    if (folder == null) throw new Exception(" sdfdfsd");
    // -- Open the folder for read only --
    folder.open(Folder.READ_ONLY);
    // -- Get the message wrappers and process them --
    Message[] msgs = folder.getMessages();
    System.out.println("ava au.com.covermore.EmailReader"
    +" msgs " + msgs.length);
    for (int msgNum = 0; msgNum < msgs.length; msgNum++)
    printMessage(msgs[msgNum]);
    //processMessage(msgs[msgNum]);
    nested exception is:
         java.net.ConnectException: Connection timed out: connect
         at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:665)
         at javax.mail.Service.connect(Service.java:295)
         at javax.mail.Service.connect(Service.java:176)
         at MyMail.read111(MyMail.java:139)
         at MyMail.main(MyMail.java:50)
    Caused by: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
         at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(Unknown Source)
         at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:288)
         at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:205)
         at com.sun.mail.iap.Protocol.<init>(Protocol.java:113)
         at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:110)
         at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:632)
         ... 4 more
    Edited by: 831679 on Jan 27, 2011 2:35 AM

    hi
    i check all those.But my error still exists
    I changed my code as follows
    String host="dsds-excas.bs-ssssmanagement.com";
                   String username="[email protected]";
                   String password="sadsdsd";
                   Properties props=new Properties();                         
                   props.put("mail.imaps.timeout", "120000");               
                   Session session = Session.getInstance(props);
         session.setDebug(true);     
         Store store = session.getStore("imaps");
         store.connect(host, username, password);
         System.out.println("Connected...");
         Folder inbox = store.getDefaultFolder().getFolder("INBOX");
         inbox.open(Folder.READ_ONLY);
         Message[] msg = inbox.getMessages();
         System.out.println(msg);
    =============================================================
    DEBUG: setDebug: JavaMail version 1.4.4
    DEBUG: getProvider() returning javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc]
    DEBUG: mail.imap.fetchsize: 16384
    DEBUG: mail.imap.statuscachetimeout: 1000
    DEBUG: mail.imap.appendbuffersize: -1
    DEBUG: mail.imap.minidletime: 10
    DEBUG: trying to connect to host "dddddddddd.bs-sssssmanagement.com", port 993, isSSL true
    javax.mail.MessagingException: Connection timed out: connect;
    nested exception is:
         java.net.ConnectException: Connection timed out: connect
         at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:665)
         at javax.mail.Service.connect(Service.java:295)
         at javax.mail.Service.connect(Service.java:176)
         at BsmMail.main(BsmMail.java:34)
    Caused by: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
         at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(Unknown Source)
         at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:288)
         at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231)
         at com.sun.mail.iap.Protocol.<init>(Protocol.java:113)
         at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:110)
         at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:632)
         ... 3 more
    ================================================
    Please help
    Edited by: 831679 on Jan 28, 2011 2:29 AM
    Edited by: 831679 on Jan 28, 2011 2:40 AM

  • Exception while sending mail using javamail

    below i am using the code to send a mail to [email protected]
    but it is giving exception
    "class com.sun.mail.smtp.SMTPSendFailedException: 554 <[email protected]>: Recipient address rejected: Relay access denied"
    please can any body help me to solve this problem
    Properties props = new Properties();
    props.put("mail.smtp.host", "xxxxxxxxxxxxx");
    Session s = Session.getInstance(props,null);
    MimeMessage message = new MimeMessage(s);
    InternetAddress from = new InternetAddress("[email protected]");
    message.setFrom(from);
    InternetAddress to = new InternetAddress("[email protected]");
    message.addRecipient(Message.RecipientType.TO, to);
    message.setSubject("Test from JavaMail.");
    message.setText("Hello from JavaMail!");
    Transport.send(message);

    I was getting the same error as the others, and I added authentication, but it still gives me the error.
    All "AutomailingUtility" constants are strings
    public class SMTPSender {
    private Session session;
    public SMTPSender() {
    Properties props = new Properties();
    props.setProperty("mail.smtp.host", AutomailingUtility.HOST);
    props.put("mail.smtp.auth", AutomailingUtility.AUTH);
    Authenticator auth = new MyAuthenticator(AutomailingUtility.USERNAME, AutomailingUtility.PASSWORD);
    session = Session.getInstance(props, auth);
    public void sendMessage(String toUser, String message, String subject) {
    try {
    Message msg = new MimeMessage(session);
    msg.setSubject(subject);
    msg.setSentDate(new Date());
    InternetAddress ia = new InternetAddress(AutomailingUtility.FROM_ADDRESS);
    msg.setFrom(ia);
    msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(toUser));
    msg.setText(message);
    Transport.send(msg);
    } catch (AddressException e) {
    e.printStackTrace();
    } catch (MessagingException e) {
    e.printStackTrace();
    any ideas?

  • BPEL interface migration to 11g : EXception while reading partner links.

    Hi All,
    I am migrating 10g BPEL interfaces to 11g using Jdev 11.1.1.4 Jdeveloper.
    After migrating an interface having partnerlink in to 11.1.1.4 Jdev , if I try to open any partner link it causes error: Failed to read the WSDL or Http Connection Error code 407 in the partner links.
    If we try to open Invoke_variables it gives error like which could not work :
    "Exception while reading schema " or "Exception - Could not retrieve message parts ."
    Note : Those partner links are already deployed on server and at the moment of this error if I try to reach these PartnerLinks through browser i am able to reach.
    I had tried following ways to come over it :
    1. changing the URL to a valid IP Address and check if you still has the issues.
    2. Bu using Abstract wsdl's in place of concrete wsdl. Make a local copy of the wsdl file and try to import the wsdl into JDev.
    3. By unchecking the Proxy Server
    JDeveloper -> Tools -> Preferences -> Web Browser and Proxy -> Uncheck "Use HTTP Proxy Server"
    Is there any way to get over this issue?
    any suggestion regarding this will be so helpful !
    Thanks & Regards,
    Nupur

    Hi folks,
    is there any solution for this error ??
    WSDL which we are trying to load is in server in US , so is there any posiblity of this error due to network latency between
    laptop (client m/c running JDEV) and the server (hosting wsdl)?
    Thanks ,
    Nupur

  • How do I listen to music or radio while reading mail, etc?

    How do I listen to music or radio while reading mail,etc.?

    If you are using the Music App, or say, Pandora, all you do start a song or album and while you are listening, hit your home button once to go to your home page.  The music will cointinue playing and then you touch your mail icon and read mail.  The music will continue playing while you're reading mail.  Just remember to close the Music when you're finished.  To do so, double tap yourhome button and you'll the most recently used apps (task bar) on the bottom.  With your finger, hold it on any app until they all start to jiggle.  You'll see on the upper left side.  Touch the minus and the app will fully close.

  • Exception while invoking webservices using Dynamic client without WSDL

    Hi All,
    I am getting the below exception while invoking webservices using Dynamic client without WSDL.
    javax.xml.rpc.soap.SOAPFaultException: Exception during processing: java.lang.RuntimeException: Missing license file for: WebLogic Platform 8.1 (see Fault Detail for stacktrace)
    at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:313)
    at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
    at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:558)
    at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:411)
    at atthi.webservice.TestWSWithWSDL.main(TestWSWithWSDL.java:41)
    Exception in thread "main"
    Please find my source file below....
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.Call;
    import javax.xml.rpc.ParameterMode;
    import javax.xml.namespace.QName;
    public class TestWSWithoutWSDL {
    public static void main(String[] args) {
    try{
    String address = "<WSDL's SOAP Address>";
    String namespaceURI = "<namespaceURI>";
    String serviceName = "<serviceName>";
    String portName = "<portName>";
    String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
    String URI_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
    String agencyID = "AGN00533";
    String fileName = "testWS";
    String xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><web-services>Sample Application</web-services>";
    System.setProperty( "javax.xml.rpc.ServiceFactory", "weblogic.webservice.core.rpc.ServiceFactoryImpl");
    ServiceFactory factory = ServiceFactory.newInstance();
    * Create an instance of the Service with the given service QName
    Service service = factory.createService(new QName(serviceName));
    Call call = service.createCall(new QName(portName));
    call.setTargetEndpointAddress(address);
    call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
    call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
    call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);
    QName stringQName = new QName("http://www.w3.org/2001/XMLSchema", "string");
    * Set operation name to invoke.
    call.setOperationName(new QName(namespaceURI,"<operationName>"));
    * Add parameters definitions in the call object.
    call.addParameter("string", stringQName, String.class, ParameterMode.IN);
    call.addParameter("string0", stringQName, String.class, ParameterMode.IN);
    call.addParameter("string1", stringQName, String.class, ParameterMode.IN);
    * Set definition of the return type.
    call.setReturnType(stringQName);
    Object[] inParams = new Object[3];
    inParams[0] = new String(agencyID);
    inParams[1] = new String(fileName);
    inParams[2] = new String(xmlString);
    String result = ((String)call.invoke(inParams)).toString();
    System.out.println(result);
    }catch (Exception e){
    e.printStackTrace();
    Please give your suggestions for the above said exception....
    Thanks & Regards....

    Hi All,
    I am getting the below exception while invoking webservices using Dynamic client without WSDL.
    javax.xml.rpc.soap.SOAPFaultException: Exception during processing: java.lang.RuntimeException: Missing license file for: WebLogic Platform 8.1 (see Fault Detail for stacktrace)
    at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:313)
    at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
    at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:558)
    at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:411)
    at atthi.webservice.TestWSWithWSDL.main(TestWSWithWSDL.java:41)
    Exception in thread "main"
    Please find my source file below....
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.Call;
    import javax.xml.rpc.ParameterMode;
    import javax.xml.namespace.QName;
    public class TestWSWithoutWSDL {
    public static void main(String[] args) {
    try{
    String address = "<WSDL's SOAP Address>";
    String namespaceURI = "<namespaceURI>";
    String serviceName = "<serviceName>";
    String portName = "<portName>";
    String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
    String URI_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
    String agencyID = "AGN00533";
    String fileName = "testWS";
    String xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><web-services>Sample Application</web-services>";
    System.setProperty( "javax.xml.rpc.ServiceFactory", "weblogic.webservice.core.rpc.ServiceFactoryImpl");
    ServiceFactory factory = ServiceFactory.newInstance();
    * Create an instance of the Service with the given service QName
    Service service = factory.createService(new QName(serviceName));
    Call call = service.createCall(new QName(portName));
    call.setTargetEndpointAddress(address);
    call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
    call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
    call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);
    QName stringQName = new QName("http://www.w3.org/2001/XMLSchema", "string");
    * Set operation name to invoke.
    call.setOperationName(new QName(namespaceURI,"<operationName>"));
    * Add parameters definitions in the call object.
    call.addParameter("string", stringQName, String.class, ParameterMode.IN);
    call.addParameter("string0", stringQName, String.class, ParameterMode.IN);
    call.addParameter("string1", stringQName, String.class, ParameterMode.IN);
    * Set definition of the return type.
    call.setReturnType(stringQName);
    Object[] inParams = new Object[3];
    inParams[0] = new String(agencyID);
    inParams[1] = new String(fileName);
    inParams[2] = new String(xmlString);
    String result = ((String)call.invoke(inParams)).toString();
    System.out.println(result);
    }catch (Exception e){
    e.printStackTrace();
    Please give your suggestions for the above said exception....
    Thanks & Regards....

  • I/O exception while reading

    I got an error I/O exception while reading : E:\SampleCheckboxes2.html (The system can not find the file specified )
    What does it mean ??? what should I do ? I am very new in Java

    It means the file is not there. Check to make sure the file is in the specified location, if it is, check the spelling.

  • Read mail using java, and set the mail

    How can I read mail and set message "SEEN" with java? (javax.mail)
    IMAP supports flags; so there are no problems, just using
    msg.setFlag(Flags.Flag.SEEN, true);
    but,
    POP3 does not support flags; how can I solve this in POP3? I have searched for this problem, found that I can just check for the header "Status", but this header does not exsist. Then I tried to add this header, but again, then I got IllegalWriteException cause pop3-msg is writeprotected (yes: I opened the folder READ_WRITE); so; does anyone know how I can solve this problem?

    Hi !
    Could u plz send me the code u r having for reading mails using IMAP...actually v r trying to read mails from outlook but due to some security reasons our team has decided not to use pop3 ...
    Thanks in Advance
    sha

  • Error while sending mail using script task in ssis 2008

    Hi,
        i am trying to send mail using ssis 2008 script task.for my requirement i am not able to use send mail task.
    code i have used is
    declared read only variables system::packagename
     Dim PACKAGE As String
            PACKAGE = Dts.Variables("System::PackageName").Value.ToString()
            Dim myHtmlMessage As MailMessage
            Dim mySmtpClient As SmtpClient
            myHtmlMessage = New MailMessage("[email protected]", "[email protected]", "PACKAGE STATUS", PACKAGE + "WAS FAILED")
         mySmtpClient = New SmtpClient("smtp.gmail.com")
            mySmtpClient.Credentials = New NetworkCredential("[email protected]", "mypassword")
            mySmtpClient.EnableSsl = True
            mySmtpClient.Port = 587
            mySmtpClient.Send(myHtmlMessage)
    error i am getting is
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
    can any one tell me where i am going wrong

    also getting error as follows
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

  • Authentication Failed Exception

    Hello every one,
    this is my second post to this problem, my problem is not solved yet. i tried lots of ways but not worked, please help me.
    i m trying to send a mail, it connects to the mail server but can't authenticate it, i cant uderstand where i m wrong.
    my code is
    try
    Properties props = new Properties();
    props.put("mail.smtp.host",smtpHost);
    props.put("mail.smtp.port",smtpPort);
    props.put("mail.smtp.auth","true");
    SMTPAuthenticator auth = new SMTPAuthenticator(user,pass);
    Session session = Session.getInstance(props,auth);
    session.setDebug(true);
    Message msg = new MimeMessage(session);
    msg.setSentDate(new Date());
    msg.setFrom(new InternetAddress(from));
    InternetAddress[] addTo = new InternetAddress[to.length];
    for(int i=0; i<to.length; i++)
    addTo[i] = new InternetAddress(to);
    msg.setRecipients(Message.RecipientType.TO, addTo);
    msg.setSubject(subject);
    msg.setHeader("Email Notification",from);
    MimeBodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setContent(content,"text/plain");
    Multipart multipart = new MimeMultipart();
    multipart.addBodyPart(messageBodyPart);
    if(attach != null && attach[0] != null)
    for(int i=0; i<attach.length; i++)
    messageBodyPart = new MimeBodyPart();
    DataSource source=null;
    source = new FileDataSource(attach[i]);
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(source.getName());
    multipart.addBodyPart(messageBodyPart);
    msg.setContent(multipart);
    Transport.send(msg);
    String host = "202.41.70.1";
    String port = "25";
    String usr = "sachin";
    String pwd = "xxxxx";
    String frm = "sachin";
    String[] to={"[email protected]","[email protected]","[email protected]"};
    String sub = "Email Notificatio through JavaMail";
    String con = "This is a test mail send through the Java Mail API";
    try
    send s = new send(host,port,usr,pwd,frm,to,sub,con,null);
    catch(Exception e)
    e.printStackTrace();
    }It is simple java program and it gives following trace
    DEBUG: setDebug: JavaMail version 1.4ea
    DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.s
    mtp.SMTPTransport,Sun Microsystems, Inc]
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: trying to connect to host "202.41.70.1", port 25, isSSL false
    220 bioinfo.ernet.in ESMTP Sendmail 8.13.1/8.13.1; Thu, 9 Nov 2006 17:18:41 +053
    0
    DEBUG SMTP: connected to host "202.41.70.1", port: 25
    EHLO pc-56
    250-bioinfo.ernet.in Hello mm-pc56.bioinfo.ernet.in [202.41.70.56], pleased to m
    eet you
    250-ENHANCEDSTATUSCODES
    250-PIPELINING
    250-8BITMIME
    250-SIZE
    250-DSN
    250-AUTH DIGEST-MD5 CRAM-MD5
    250-DELIVERBY
    250 HELP
    DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
    DEBUG SMTP: Found extension "PIPELINING", arg ""
    DEBUG SMTP: Found extension "8BITMIME", arg ""
    DEBUG SMTP: Found extension "SIZE", arg ""
    DEBUG SMTP: Found extension "DSN", arg ""
    DEBUG SMTP: Found extension "AUTH", arg "DIGEST-MD5 CRAM-MD5"
    DEBUG SMTP: Found extension "DELIVERBY", arg ""
    DEBUG SMTP: Found extension "HELP", arg ""
    DEBUG SMTP: Attempt to authenticate
    DEBUG DIGEST-MD5: Loaded
    AUTH DIGEST-MD5
    334 bm9uY2U9IllMM2RRRzc0Q3YraWI5MkJ5QXdEOCt0QjI5elIvdFNzNmUweG9la1lqTGc9IixyZWFs
    bT0iYmlvaW5mby5lcm5ldC5pbiIscW9wPSJhdXRoLGF1dGgtaW50LGF1dGgtY29uZiIsY2lwaGVyPSJy
    YzQtNDAscmM0LTU2LHJjNCxkZXMsM2RlcyIsbWF4YnVmPTgxOTIsY2hhcnNldD11dGYtOCxhbGdvcml0
    aG09bWQ1LXNlc3M=
    DEBUG DIGEST-MD5: Begin authentication ...
    DEBUG DIGEST-MD5: Received => nonce='YL3dQG74Cv+ib92ByAwD8+tB29zR/tSs6e0xoekYjLg
    ='
    DEBUG DIGEST-MD5: Received => realm='bioinfo.ernet.in'
    DEBUG DIGEST-MD5: Received => qop='auth,auth-int,auth-conf'
    DEBUG DIGEST-MD5: Received => cipher='rc4-40,rc4-56,rc4,des,3des'
    DEBUG DIGEST-MD5: Received => maxbuf='8192'
    DEBUG DIGEST-MD5: Received => charset='utf-8'
    DEBUG DIGEST-MD5: Received => algorithm='md5-sess'
    DEBUG DIGEST-MD5: Response => username="sachin",realm="bioinfo.ernet.in",qop=aut
    h,nc=00000001,nonce="YL3dQG74Cv+ib92ByAwD8+tB29zR/tSs6e0xoekYjLg=",cnonce="9Ko++
    L4WPLiz9bb56ZKJDsZz+QBR+ByvZTsFMJPAThU=",digest-uri="smtp/202.41.70.1",response=
    fcc111db97f183ca954743c9f6dfef70
    dXNlcm5hbWU9InNhY2hpbiIscmVhbG09ImJpb2luZm8uZXJuZXQuaW4iLHFvcD1hdXRoLG5jPTAwMDAw
    MDAxLG5vbmNlPSJZTDNkUUc3NEN2K2liOTJCeUF3RDgrdEIyOXpSL3RTczZlMHhvZWtZakxnPSIsY25v
    bmNlPSI5S28rK0w0V1BMaXo5YmI1NlpLSkRzWnorUUJSK0J5dlpUc0ZNSlBBVGhVPSIsZGlnZXN0LXVy
    aT0ic210cC8yMDIuNDEuNzAuMSIscmVzcG9uc2U9ZmNjMTExZGI5N2YxODNjYTk1NDc0M2M5ZjZkZmVm
    NzA=
    535 5.7.0 authentication failed
    javax.mail.AuthenticationFailedException
    at javax.mail.Service.connect(Service.java:306)
    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 send.<init>(send.java:67)
    at send.main(send.java:87)
    Hope any one will solve my problem, i am waiting for reply here tonight

    Hi .
    I tried your code , and I got the same exeption ..
    But when I changed a little bit in it , it worked ... :
    Properties props = new Properties();
    props.put("mail.smtp.host","host");
    props.put("mail.smtp.port","25");
    props.put("mail.smtp.auth","true");
    Session session = Session.getInstance(props,null);
    session.setDebug(true);
    Message msg = new MimeMessage(session);
    msg.setSentDate(new Date());
    msg.setFrom(new InternetAddress("[email protected]"));
    InternetAddress[] addTo = new InternetAddress[1];
    for(int i=0; i<addTo.length; i++)
    addTo[i] = new InternetAddress("[email protected]");
    msg.setRecipients(Message.RecipientType.TO, addTo);
    msg.setSubject("HIIIIIIIIIIIII");
    msg.setText("HIIIIIIIIIIII");
    Transport tr = session.getTransport("smtp");
    tr.connect("[email protected]","xxxx");
    tr.sendMessage(msg,msg.getAllRecipients());
    Actually I used : tr.sendMessage(msg,msg.getAllRecipients());
    instead of : tr.send(msg) and it worked for me ..
    Plase try it and let me know ..
    Omar Dawod .

  • SMICM error while sending mail using SMTP server

    Hi All,
    We are not able send mails using SMTP server.
    We have made every settings necessary in SCOT, SO16 , SMTP service is activated, default domain is maintained etc
    Only things which seems to be wrong is in SMICM trace file.
    [Thr 13] *** ERROR => NiBufIConnect: non-buffered connect pending after 5000ms (hdl 29;10.26.24.44:1090) [nibuf.cpp    4608]
    [Thr 13] *** WARNING => Connection request from (0/1/0) to host: 10.26.24.44, service: 1090 failed (NIECONN_REFUSED)
    [icxxconn_mt.c 2321]
    This error is getting repeated in it.
    BUt I am not sure why it it trying to hit 10.26.24.44, as we dont have any server by this ip. The ip is only not resolvable from the server.
    1 more thing, at OS level, following parameter is maintained in profile :
    icm/server_port_1 = PROT=SMTP,PORT=25000,TIMEOUT=180
    But in SCOT, under SMTP node PORT is given as 25.
    Kindly let me know what going wrong here?
    Thanks

    also getting error as follows
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

  • Error while while reading mails

    Hi,
    I'm getting the following error while I'm trying to read mails from server where POP3 is enabled. Could anyone please let me know how I can fix it?
    Exception in thread "main" javax.mail.AuthenticationFailedException: The request
    ed mailbox is not available on this server.
    at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:159)
    at javax.mail.Service.connect(Service.java:288)
    at javax.mail.Service.connect(Service.java:169)
    at GetMessageExample.main(GetMessageExample.java:26)
    Regards,
    Abdul

    I think you may got this error due to one of the following
    There should be a problem with the host or mail server
    Your mail server requires authentication
    your authentication may fail

  • RunTime Exception while reading the file

    Hi,
    I am using aixs1.0 for my current project. I have uploading an image file. if the file is in c: drive then upload successfully. if the file is in desktop it gives socket connection exception. while the desktop name is with .v example.c:\documents and settings\srinivas.v\desktop\image2.gif when I amreding this file from the project it gives the following error. can u please help in this regard
    10/10 18:33:12 error [axis] java.io.IOException:
    java.net.SocketException: Software caused connection abort: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at java.io.BufferedOutputStream.write(BufferedOutputStream.java:106)
    at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:336)
    at sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:395)
    at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:136)
    at java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
    at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111)
    at java.io.BufferedWriter.write(BufferedWriter.java:206)
    at java.io.Writer.write(Writer.java:126)
    at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:277)
    at org.apache.axis.Message.writeTo(Message.java:440)
    at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.ja
    va:466)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:122)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
    y.java:71)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
    at org.apache.axis.client.Call.invoke(Call.java:2553)
    at org.apache.axis.client.Call.invoke(Call.java:2248)
    at org.apache.axis.client.Call.invoke(Call.java:2171)
    at org.apache.axis.client.Call.invoke(Call.java:1691)
    at com.stellent.www.CheckIn.CheckInSoapStub.checkInUniversal(CheckInSoap
    Stub.java:210)
    at jrun__Product_Info__CompetitiveProductConfirmation2ejsp30._jspService
    (jrun__Product_Info__CompetitiveProductConfirmation2ejsp30.java:266)
    at jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43)
    at jrun.jsp.JSPServlet.service(JSPServlet.java:119)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
    at jrun.servlet.security.StandardSecurityFilter.doFilter(StandardSecurit
    yFilter.java:103)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
    at jrun.servlet.FilterChain.service(FilterChain.java:101)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
    249)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
    527)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPoo
    l.java:348)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
    ava:451)
    at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.
    java:294)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    10/10 18:39:47 error
    java.lang.NullPointerException
    at jrun__Home__Home2ejspe._jspService(jrun__Home__Home2ejspe.java:182)
    at jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43)
    at jrun.jsp.JSPServlet.service(JSPServlet.java:119)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
    at jrun.servlet.security.StandardSecurityFilter.doFilter(StandardSecurit
    yFilter.java:103)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
    at jrun.servlet.FilterChain.service(FilterChain.java:101)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invokeNext(JRunRequestDispatcher.j
    ava:447)
    at jrun.servlet.JRunRequestDispatcher.forwardInvoke(JRunRequestDispatche
    r.java:417)
    at jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java
    :175)
    at jrun.servlet.file.FileServlet.service(FileServlet.java:306)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
    at jrun.servlet.security.StandardSecurityFilter.doFilter(StandardSecurit
    yFilter.java:103)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
    at jrun.servlet.FilterChain.service(FilterChain.java:101)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
    249)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
    527)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPoo
    l.java:348)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
    ava:451)
    at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.
    java:294)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    ThankYou
    Srinivas Vakkalanka

    Hi,
    check the MOS Note: readDomain() on UnPacked WLS 12c Domain will Fail with com.oracle.cie.common.CommonException: fail to load domain from directory. (Doc ID 1681602.1)
    https://support.oracle.com/epmos/faces/DocContentDisplay?id=1681602.1
    Borys

  • Download already read mail from POP

    Hello,
    I have a Yahoo! mail account that I download through Mail. I recently made a big mistake and nixed a bunch of messages. The messages are still on the Yahoo! mail server, but I can't get Mail to download them. I've tried marking the messages as "unread" in Yahoo! webmail, but Mail still won't download the old messages.
    How can I force Mail to get those old messages?
    Thanks,
    Dustin

    Try the following:
    Quit Mail first and using the Finder go to Home > Library > Mail > this POP account named folder (named by the user name and incoming mail server for the account) > MessageUidsAlreadyDownloaded2 file and empty the Trash.
    Launch Mail and if successful, any messages previously downloaded by Mail that remain on the server will be downloaded again along with any other messages that remain in the account's Inbox mailbox at the server not yet downloaded by Mail.

Maybe you are looking for