Win a copy of Programmers Guide to Apache Thrift this week in the Open Source forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

sending automatic javamail from a website using java mail API  RSS feed

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Below is my code for sending an automatic mail on registration from my website:





And when i run this on my eclipse its throwing exception the stack trace is as below:







And the jar files i have in my eclipse build path are javax.mail.jar , activation.jar, commons-email-1.0.jar Please help me resolve this... Thanks in advance...

 
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing JDBC related here, moving to a better forum...
 
sunaina agarwal
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry by mistake i posted it here .... How to move it to another forum... Should i have to close this and post a new question in the another forum or is there any other way to do it??
 
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it's OK, Martin moved it already.

587 is the Gmail TLS port, not the SSL port (which would be 465). You need to set some properties accordingly: http://www.mkyong.com/java/javamail-api-sending-email-via-gmail-smtp-example/
 
sunaina agarwal
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@UlfDittmer hey i used the code from MK yong only but it was giving me some exception like "must issue STARTTLS command first" then i added a new jar file javaxmail.jar of version1.5. then it worked and now its giving me the exception as in the above question... Am banging my head on this issue from last three days please help me resolve this..
 
Ulf Dittmer
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I said, the properties you're using enable SSL, not TLS, so your code differs from the code in the article.
 
sunaina agarwal
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
k i tried the same code as in the article so its giving me this exception now:




Sorry i had to post the whole stack trace because its giving me this exception every time i run it .
 
sunaina agarwal
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i resolved this by adding just one line of code:



It worked like miracle... thank you all.....
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!