I trying to send email from server using JavaMail and smtp protocol. The email is name@mydomain.com. JavaMail is throwing the exception above and this message "Client does not have permissions to send as this sender ". Can someone tell me what to do? I have my email configured with 365 server.
Exception in thread "main" java.lang.RuntimeException: com.sun.mail.smtp.SMTPSendFailedException: 550 5.7.60 SMTP; Client does not have permissions to send as this sender
at ao.co.karrega.test.ExtendedKarregaEmail.Send(ExtendedKarregaEmail.java:120)
at ao.co.karrega.test.mainEmail.main(mainEmail.java:11)
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 550 5.7.60 SMTP; Client does not have permissions to send as this sender
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2057)
at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1862)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1100)
at javax.mail.Transport.send0(Transport.java:195)
at javax.mail.Transport.send(Transport.java:124)
at ao.co.karrega.test.ExtendedKarregaEmail.Send(ExtendedKarregaEmail.java:115)
... 1 more