简体   繁体   中英

i cant send mail with java mail api in android studio

I need to send an email when clicking on a button without using gmail clients. For this I am using the java mail api, and I am basing myself on the code of the following references:

https:/.netcorecloud.com/tutorials/send-email-in-android-using-javamail-api/?fbclid=IwAR0hiFPFrpajzldPB-MhnY-FI6n11aRaiY1_2sFCniHQhHvUa7BiAI8HON8

Sending Email in Android using JavaMail API without using the default/built-in app

I have tried placing some logs to print/debug things and I realized that the last part of the code is not executed Transport.send(message);

sorry for my english, but your problem is probably that you didn't generate the password for the app, from May 30, 2022 the less security option was discontinued by google now you have to follow this step by step https://support.google.com/accounts/answer/185833
in the end it will be generated a 16-digit password, just put it in place of your current password

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM