Unable to Send Email Due To SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

When sending a test email in Confluence, the email is not sent and the following errors are displayed:

1 2 3 4 5 6 7 8 9 com.atlassian.mail.MailException: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:200) at com.atlassian.confluence.jmx.JmxSMTPMailServer.send(JmxSMTPMailServer.java:80) at com.atlassian.confluence.admin.actions.mail.SendTestEmailAction.execute(SendTestEmailAction.java:52) .... Caused by: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. w5sm4960856pax.28 at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1515) at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1054) ....

Cause

Many modern email servers require that a secure connection is established between themselves and client applications. This isn't possible to configure in the Confluence UI, and must be done by creating a JNDI resource, as detailed in Setting Up a Mail Session for the Confluence Distribution. The ability to create a secure connection to a mail server via the UI is being tracked in: CONFSERVER-18770 - Make configuring SMTP with SSL easier

This problem can also occur if the JNDI SMTP resource is incorrectly configured. Namely, the property mail.smtp.starttls.enable is not enabled.

Resolution

  • Ensure that your instance is using a "JNDI Location" (see: Setting Up a Mail Session for the Confluence Distribution).

  • Ensure that the SmtpServer resource section has the mail.smtp.starttls.enable set to "true", for example:

    Tomcat 5.5 or Tomcat 6

    1 2 3 4 5 6 7 8 9 10 11 <Resource name="mail/Session" auth="Container" type="javax.mail.Session" mail.smtp.host="smtp.gmail.com" mail.smtp.port="465" mail.smtp.auth="true" mail.smtp.user="nobody@gmail.com" password="foobar" mail.smtp.starttls.enable="true" mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory" />
Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.