I was trying to send email without user interaction. every thing worked until the part for sending.
This is the sendemail function in the Gmailsender class that I a
I am getting the "test 3" log which means that the exception happened..
The result is that the email is not sent and the app is stuck... I dont know what is the wrong..
Blind assumption, Just Put your Mail sending code in AsyncTask
. I think the reason for your Exception is NetworkOnMainThread..
Also post the full stacktrace of Exception. So we can further help you..
Update:
I think this line transport.connect(host, from, pass);
from sendEmail()
gives you Exception.