Solution 1 :
You can use the Java Mail API:
Here is an example for sending an email with GMail.
https://stackoverflow.com/a/47452/13912132
You will need the JAR-Files (Website: https://javaee.github.io/javamail/)
Or with maven:
<dependencies>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>
Problem :
As a beginner in android, I am developing a Tasks manager app.
There is an option in the app, where the app can send the user a reminder by email on the date and time he wants, is there any way to do it?
The email’s body will contain the Task’s title and other info about it.
Comments
Comment posted by Mateo Hervas
I believe that is a task for a backend mail server to do. Your app shouldn’t handle that logic. Instead you should have a server where you can save your reminder data and program it to send an email on the date and time.
Comment posted by ak_ourb
I am saving the reminder data in Firebase. But how can I program it to send the email on a specific date and time? That’s exactly the problem I am facing.
Comment posted by developer.android.com/reference/android/app/job/JobScheduler
Since you using firebase why don’t you try the Cloud Scheduler you basically need something similar to a cron job or task scheduler. Also