sending email without user interaction android

前端 未结 3 557
隐瞒了意图╮
隐瞒了意图╮ 2021-01-15 16:43

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

3条回答
  •  终归单人心
    2021-01-15 17:22

    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.

提交回复
热议问题