I’m going to show you how to send email from android app using java mail API. Watch to learn how it work and don’t forget to turn on your notifications!
First you need to create app password for send email from app.Follow the instructions.
Create & use App Passwords
Go to your Google Account.
On the left navigation panel, choose Security.
On the "Signing in to Google" panel, choose App Passwords. If you don’t see this option:
2-Step Verification is not set up for your account.
2-Step Verification is set up for security keys only.
Your account is through work, school, or other organization.
You’ve turned on Advanced Protection for your account.
At the bottom, choose Select app and choose the app you’re using.
Choose Select device and choose the device you’re using.
Choose Generate.
Follow the instructions to enter the App Password. The App Password is the 16-character code in the yellow bar on your device.
Choose Done.
https://code.google.com/archive/p/javamail-android/downloads
sending send mail and checking JavaEmailApi is working or not..!!
JavaEmailApi working fine.
below is the screenshot of getting Email from 1st device
Foreground Service Screen | Gmail App screen |
---|---|
![]() |
![]() |