Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java mail using gmail

 
blv krishna
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I wrote the following to send mail using java.




But i got the following ERROR.

SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first

Anyone please help me to reslove this error.

 
Steve Luke
Bartender
Posts: 4181
21
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi welcome to CodeRanch :-)

First, when you post code can you please use code tags? You can use the by putting [code][/code] tags around the code, or by using the Code button at the top of the message form. The code tags make it a lot easier to read your code. You can go ahead and add the code tags back into the message now using the button.


To your question. It looks like if you add the following line to your code, prior to sending the message, it works.
 
blv krishna
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Steve,

After adding the below statement also i am getting the same error.

 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the section about Gmail in the JavaMail FAQ yet?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic