Home  >  Forum  >  Spring
Post New Query

SMTPSendFailedException: Must issue a STARTTLS command first


joined on
August 11,2014
Asked on February 25,2015
Hi Friends,

I am new in email API. I am trying  to send email using spring and Gmail SMTP and getting below error.

Exception in thread "main" org.springframework.mail.MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. lq2sm43102687pab.34 - gsmtp
; message exception details (1) are:
Failed message 1:
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. lq2sm43102687pab.34 - gsmtp

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 org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:433)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:345)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340)
joined on
October 10,2013
Replied on February 25,2015

Use

Properties prop = JavaMailSenderImpl.getJavaMailProperties();
prop.put("mail.smtp.starttls.enable", "true");

It may solve your problem.

Write Answer



Sitewide-Feb4of4234x60





Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us