Search code examples
javaemailjakarta-mail

Java Mail Initial Access check failure


I am working with Java Mail API, i am getting this strange error: "Initial Access check failure"

My configuration looks fine, URL, user, pwd, etc. Just cannot figure out why this message comes up.

550 5.7.1 Initial access check failure
DEBUG SMTP: got response code 550, with response: 550 5.7.1 Initial access check failure

RSET
250 2.5.0 Ok.
DEBUG SMTP: MessagingException while sending, THROW:
com.sun.mail.smtp.SMTPSendFailedException: 550 5.7.1 Initial access check failure
;
  nested exception is:
        com.sun.mail.smtp.SMTPSenderFailedException: 550 5.7.1 Initial access check failure

        at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2133)
        at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1630)
       at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1132)
        at javax.mail.Transport.send0(Transport.java:254)
        at javax.mail.Transport.send(Transport.java:124)
        at com.mrd.utilities.SendMailMessage.sendNewsMobileDeviceAlert(SendMailMessage.java:277)
        at DBManager.sendLowVolumeEmailAlert(DBManager.java:241)
        at DBManager.executeQuery(DBManager.java:168)
        at DBManager.getConnection(DBManager.java:109)
        at MainClass.main(MainClass.java:37)
Caused by: com.sun.mail.smtp.SMTPSenderFailedException: 550 5.7.1 Initial access check failure

        at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1637)
        ... 8 more
QUIT
221 2.3.0 Bye received. Goodbye.

Solution

  • I got this issue and resolved it by providing access to my server and sender email id on SMTP server. SMTP servers are restricted as to which server can send email from what sender email id. Contact with your SMTP administrator have them grant permission to your server ip and sender email id.