I am using a code for sending e-mail, I call the e-mail service and choose a certain e-mail that is already configured on the mobile phone. It's all working normally, however I want to put an alert after sending this email but I can not display it at the right time because I do not have a positive or negative response from sending that email. How do I know that the email was actually sent? Here's my code ...
Intent sendEmail = new Intent(Intent.ACTION_SEND);
sendEmail.putExtra(Intent.EXTRA_EMAIL, new String[]{to});
sendEmail.putExtra(Intent.EXTRA_SUBJECT, assunto);
sendEmail.putExtra(Intent.EXTRA_CC, new String[]{email});
sendEmail.putExtra(Intent.EXTRA_STREAM, imageUri);
sendEmail.putExtra(Intent.EXTRA_TEXT, "texto...");
sendEmail.setType("message/rfc822");
startActivity(Intent.createChooser
(sendEmail, "Enviar o e-mail com: "));
AlertDialog.Builder alert = new AlertDialog.Builder(activity);
alert.setTitle("Obrigado pelo contato !");
alert.setMessage("texto...");
alert.setPositiveButton("OK", null);
alert.show();