I use the following code to send an email to an email address. When I click the submit button, there is a toast message that says “Send ...”, but I don’t have it in the code. It should be the default. My problem is that it says that the message should be sent, but does not say that it was sent. I know that it cannot be checked if it arrived, but there should be an msg saying that it was sent. I hope this shows an error when it is not sent, but users do not know this.
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"something@gmail.com"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT , "body of email");
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(About.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
thank
source
share