I want to understand the concept like when we do something , we recieve a email that you have done this. how this works? if i talk about a android app there was a task that i completed. now i recieve an email that i have completed. point is from where that email was sent? it was staticaly coded in app and reciever email obtained and email sent? or something else. i found this to send email but it should be sent from background.
public void sendMailHomeButton(View view) {
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, "xxx");
intent.putExtra(Intent.EXTRA_TEXT, "xxx");
intent.setData(Uri.parse("mailto:xxxx.xxxxxx@xxxxx.com")); // or just "mailto:" for blank
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // this will make such that when user returns to your app, your app is displayed, instead of the email app.
startActivity(intent);
}