Network on Main Thread exception while trying to send e-mails in Android without user intervention [duplicate]

StackOverflow https://stackoverflow.com/questions/16546772

Question

I tried to implement the sending of emails without user intervention as explained in a post that's open for this issue: Sending Email in Android using JavaMail API without using the default/built-in app but I did not send the e-mails. I get the following error: "NetworkOnMainThreadException" Can anyone help?

PD. I don´t put this comment in this post because I don't leave, I guess that is closed. Thank you.

Was it helpful?

Solution

you can not perform network operation in main Thread.. Use asyncTask instead

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top