locked
Unable to send emails through java code using office 365 email & smtp server RRS feed

  • Question

  • We are using Language – Java, library- Javax.mail (version 1.6.0) for sending emails through our code, with below mentioned configurations :

    authentication = true
    starttls = true
    smtpHost = smtp.office365.com

    smtpPort = 587

    With the same details, emails were sent till last month but now they are not being sent with below error message:

    javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful [MAXPR0101CA0020.INDPRD01.PROD.OUTLOOK.COM]

        at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:950)
        at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:861)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:766)
        at javax.mail.Service.connect(Service.java:388)
        at javax.mail.Service.connect(Service.java:246)
        at javax.mail.Service.connect(Service.java:195)
        at javax.mail.Transport.send0(Transport.java:254)
        at javax.mail.Transport.send(Transport.java:124)
        at com.lotus.utils.EmailManagement.userAccountVerificationMail(EmailManagement.java:93)
        at com.lotus.utils.EmailManagement.main(EmailManagement.java:869)

    Friday, February 23, 2018 9:08 AM

All replies

  • Hi Nithin,

    Thank you for visiting Outlook Forum.

    Then here we mainly focus on  general questions and feedback related to Outlook desktop application. Since your issue is more related to code, please post it to Stack Overflow Forum to get better response.

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

    Thank you for your understanding.

    Regards,

    Perry


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    • Proposed as answer by Perry-Pan Tuesday, February 27, 2018 9:30 AM
    Monday, February 26, 2018 7:19 AM