com.day.cq.mailer.MailingException: org.apache.commons.mail.EmailException: Sending the email to the following server failed : xxxxxxxxxxxxx:25
at com.day.cq.mailer.impl.DefaultMailService.send(DefaultMailService.java:302)
at com.day.cq.mailer.impl.DefaultMailService.sendEmail(DefaultMailService.java:248)
at com.day.cq.wcm.foundation.forms.impl.MailServlet.doPost(MailServlet.java:314)
at org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:146)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:342)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:374)
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552)
at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:71)
at com.adobe.granite.rest.assets.impl.AssetContentDispositionFilter.doFilter(AssetContentDispositionFilter.java:96)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:138)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
Caused by: org.apache.commons.mail.EmailException: Sending the email to the following server failed : xxxxxxxxxxxxx:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1469)
at org.apache.commons.mail.Email.send(Email.java:1496)
at com.day.cq.mailer.impl.DefaultMailService.send(DefaultMailService.java:300)
... 133 common frames omitted
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 530 #5.7.0 Must issue a STARTTLS command first
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2108)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1609)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1117)
at javax.mail.Transport.send0(Transport.java:254)
at javax.mail.Transport.send(Transport.java:124)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1459)
... 135 common frames omitted
The reason is the mail server connection is enabled through plain text on port 25 and the mail server is expecting to upgrade the plain text connection to secure connection with STARTTLS command to establish the email communication.
Below are the options to connect email client with email server:
Pain text:
SSL/TLS:
STARTTLS:
To fix the issue enable "SMTP use StartTLS" option through "Day CQ Mail Service" OSGI system configuration