This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to send email using JavaMail API:getting error Must issue a STARTTLS command first. o1sm34552  RSS feed

 
Monica Shiralkar
Ranch Hand
Posts: 914
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JavaMail FAQ has an entry explaining how to access Gmail via JavaMail.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!