| Author |
Unable to send email using JavaMail API:getting error Must issue a STARTTLS command first. o1sm34552
|
Monica. Shiralkar
Ranch Hand
Joined: Jul 07, 2012
Posts: 188
|
|
I am trying to send email using java mail API. I tried to run code (below in the email) but am getting error below error message:
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. o1sm34552478pax.2 - gsmtp
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2109)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1610)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1118)
at javax.mail.Transport.send0(Transport.java:195)
at javax.mail.Transport.send(Transport.java:124)
at SendMailBySite.main(SendMailBySite.java:35)
Below is the code I am using:
Please advice how to get rid of this error message and send mail successfully.
Thanks.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
The JavaMail FAQ has an entry explaining how to access Gmail via JavaMail.
|
 |
 |
|
|
subject: Unable to send email using JavaMail API:getting error Must issue a STARTTLS command first. o1sm34552
|
|
|