This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with sending email  RSS feed

 
Miri Yusifli
Ranch Hand
Posts: 42
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone , I want to send email and I can . But in my code Java is waiting for sending email and method does not finish till sending email . How can I insert db by doesn't depending on email . I write code as two process which doesn't depend on each other . This is my code ,I hope that , you can understand me ,  Thanks in advance .

 
Tim Moores
Saloon Keeper
Posts: 3953
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm assuming that you mean the emailService.sendMail method does not return immediately. The first approach to look into would be to have that method spin off the actual sending (which apparently blocks the code) into a separate thread.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!